@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary:      #B8922E;
    --primary-dark: #9A7020;
    --primary-light:#C9A84C;
    --bg:           #F5F2EB;
    --bg-white:     #FFFFFF;
    --text-dark:    #1A1814;
    --text-mid:     rgba(26,24,20,0.68);
    --text-light:   rgba(26,24,20,0.48);
    --text-muted:   rgba(26,24,20,0.35);
    --border:       rgba(0,0,0,0.08);
    --border-light: rgba(0,0,0,0.06);
    --border-gold:  rgba(184,146,46,0.35);
    --gold-subtle:  rgba(184,146,46,0.08);
    --error:        #EF4444;
    --success:      #22C55E;
    --grad-btn:     linear-gradient(135deg, #B8922E 0%, #C9A84C 100%);
    --grad-input:   linear-gradient(135deg, #B8922E, #C9A84C);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(160deg, #FAF7F0 0%, #F5F2EB 55%, #F0EDE6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Background orbs */
body::before {
    content: '';
    position: fixed;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(184,146,46,0.12), transparent 70%);
    top: -150px; left: -150px;
    border-radius: 50%;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(201,168,76,0.07), transparent 70%);
    bottom: -100px; right: -100px;
    border-radius: 50%;
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
    transition: max-width 0.3s ease;
}

.auth-container.wide {
    max-width: 760px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 52px; height: 52px;
    background: var(--grad-btn);
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(184,146,46,0.3);
}

.auth-logo-icon svg { width: 26px; height: 26px; fill: white; }

.auth-logo-name {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.auth-logo-name span { color: var(--primary); }

.auth-card {
    background: white;
    border-radius: 24px;
    padding: 40px 40px;
    box-shadow: 0 8px 40px rgba(184,146,46,0.10);
    border: 1px solid rgba(184,146,46,0.15);
    animation: fadeUp 0.5s ease both;
}

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

/* Tabs */
.auth-tabs {
    display: flex;
    background: var(--bg);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 32px;
    gap: 4px;
    border: 1px solid var(--border-gold);
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
}

.auth-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(184,146,46,0.12);
}

/* Forms */
.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-title {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    letter-spacing: -0.4px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 28px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.field-row .field-group { margin-bottom: 0; }

.field-group { margin-bottom: 18px; }

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 7px;
}

.field-wrap {
    position: relative;
}

.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.field-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }

.field-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg);
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.field-input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(184,146,46,0.10);
}

.field-input::placeholder { color: var(--text-muted); }
.field-input.error { border-color: var(--error); }

/* Password toggle */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border: none;
    background: none;
    display: flex;
    align-items: center;
}

.toggle-password svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }

/* Error message */
.error-msg {
    display: none;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--error);
    margin-bottom: 16px;
    gap: 8px;
    align-items: flex-start;
}

.error-msg.show { display: flex; }

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #0a0a0a;
    background: var(--grad-btn);
    border: none;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(184,146,46,0.3);
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(184,146,46,0.45);
    opacity: 0.9;
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-submit .spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(10,10,10,0.2);
    border-top-color: #0a0a0a;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text { display: none; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Back link */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
    text-decoration: none;
    margin-top: 24px;
    justify-content: center;
    width: 100%;
    transition: color 0.2s;
}

.auth-back:hover { color: var(--primary-light); }
.auth-back svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }

@media (max-width: 640px) {
    .field-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 24px; }
}
