@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Serif+Display&display=swap');

:root {
    --primary: #C85A2F;
    --primary-hover: #A84520;
    --primary-glow: rgba(200, 90, 47, 0.15);
    --bg: #FBF7F4;
    --text-main: #1C1410;
    --text-muted: #8A7060;
    --card-bg: #FFFFFF;
    --border: #E8DDD5;
    --input-bg: #FDFAF8;
    --success-bg: #F0FBF4;
    --success-text: #166534;
    --success-border: #BBF7D0;
    --danger-bg: #FFF5F0;
    --danger-text: #92320D;
    --danger-border: #FDDCCE;
    --shadow-lg: 0 2px 6px rgba(28,20,16,0.05), 0 20px 60px rgba(28,20,16,0.12);
    --radius-sm: 9px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 60% 50% at 10% 0%, rgba(200,90,47,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 90% 100%, rgba(200,90,47,0.04) 0%, transparent 70%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(200,90,47,0.07) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

.auth-wrapper {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
}

.auth-container {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
.auth-header {
    background: linear-gradient(135deg, #1C1410 0%, #3D2617 100%);
    padding: 100px 40px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 20px;
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;              /* ✅ menyesuaikan konten */
    height: auto;
    background: transparent;  /* tidak perlu latar jika ada gambar */
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 16px;
    padding: 8px;             /* opsional: beri ruang */
    background: rgba(255,255,255,0.1); /* opsional: latar transparan halus */
    border-radius: 18px;
}

/* Khusus untuk gambar logo di dalamnya */
.auth-logo img {
    max-height: 200px;        /* lebih besar dari 80px */
    width: auto;
    height: auto;
    display: block;
}

.auth-header h2 {
    font-family: 'DM Serif Display', serif;
    color: #FDFAF8;
    font-size: 21px;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 6px;
}

.auth-header p {
    color: rgba(253,250,248,0.5);
    font-size: 13px;
}

/* ── Body ── */
.auth-body {
    padding: 32px 40px 40px;
}

/* ── Alerts ── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid;
    animation: fadeIn 0.3s ease both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-danger  { background: var(--danger-bg);  color: var(--danger-text);  border-color: var(--danger-border); }
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }

/* ── Form ── */
.form-group { margin-bottom: 18px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 11px 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14.5px;
    color: var(--text-main);
    background: var(--input-bg);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.form-control::placeholder { color: #C4B5A8; }

.form-control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3.5px var(--primary-glow);
    outline: none;
}

.required { color: var(--primary); }

/* ── Role Selector ── */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #F5EDE7;
    padding: 5px;
    border-radius: 11px;
}

.role-selector label {
    text-align: center;
    padding: 10px 8px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-muted);
    transition: all 0.2s ease;
    user-select: none;
    margin-bottom: 0;
}

.role-selector label:hover { color: var(--primary); }

.role-selector input[type="radio"]:checked + label {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(28,20,16,0.1);
}

/* ── Button ── */
.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 6px;
    position: relative;
    overflow: hidden;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(200,90,47,0.3);
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.08), transparent);
    pointer-events: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(200,90,47,0.38);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(200,90,47,0.25);
}

/* ── Footer ── */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.auth-footer a:hover { border-bottom-color: var(--primary); }

/* ── Responsive ── */
@media (max-width: 520px) {
    body {
        padding: 0;
        background: var(--card-bg);
        align-items: flex-start;
    }

    body::before { display: none; }

    .auth-wrapper { max-width: 100%; }

    .auth-container {
        border-radius: 0;
        border: none;
        box-shadow: none;
        min-height: 100vh;
    }

    .auth-header {
        padding: 150px 24px 26px;
        border-radius: 0;
    }

    .auth-body { padding: 24px 24px 36px; }

    .auth-logo img {
        max-height: 150px;     /* sedikit lebih kecil di HP, tapi tetap jelas */
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 360px) {
    .auth-header { padding: 100px 18px 20px; }
    .auth-body   { padding: 20px 18px 30px; }
    .auth-logo img {
        max-height: 100px;     /* sedikit lebih kecil di HP, tapi tetap jelas */
    }
}