/* ============================================================
   FoodHouse — Auth Styles (Login / Register)
   ============================================================ */

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

:root {
    --primary:       #F5A623;
    --primary-dark:  #D4891A;
    --navy:          #1A1A2E;
    --text:          #1C1C1C;
    --text-muted:    #6B7280;
    --border:        #E5E7EB;
    --bg:            #F9FAFB;
    --white:         #FFFFFF;
    --danger:        #EF4444;
    --success:       #10B981;
    --transition:    .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1A1A2E 0%, #2D2D44 40%, #16213E 100%);
    position: relative; overflow-x: hidden;
}

/* Animated background orbs */
body::before, body::after {
    content: ''; position: fixed;
    border-radius: 50%; filter: blur(80px); opacity: .25;
    pointer-events: none; animation: float 8s ease-in-out infinite;
}
body::before {
    width: 400px; height: 400px;
    background: var(--primary);
    top: -100px; right: -100px;
}
body::after {
    width: 300px; height: 300px;
    background: #6C63FF;
    bottom: -80px; left: -80px;
    animation-delay: -4s; animation-direction: reverse;
}
@keyframes float {
    0%,100% { transform: translate(0,0) scale(1); }
    50%      { transform: translate(30px,20px) scale(1.05); }
}

/* Auth Container */
.auth-container {
    position: relative; z-index: 10;
    width: 100%; max-width: 460px;
    padding: 20px;
}

/* Auth Card */
.auth-card {
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 32px 80px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.1);
}

/* Logo */
.auth-logo {
    text-align: center; margin-bottom: 28px;
}
.auth-logo-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--white);
    overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.2);
    border: 3px solid var(--border);
}
.auth-logo-icon img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.auth-logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem; font-weight: 800;
    color: var(--navy);
}
.auth-logo h1 span { color: var(--primary); }
.auth-subtitle {
    font-size: .875rem; color: var(--text-muted); margin-top: 4px;
}

/* Tabs */
.auth-tabs {
    display: flex; background: var(--bg);
    border-radius: 12px; padding: 4px;
    margin-bottom: 28px;
}
.auth-tab {
    flex: 1; padding: 10px; border-radius: 9px;
    font-size: .875rem; font-weight: 500; color: var(--text-muted);
    cursor: pointer; transition: var(--transition); text-align: center;
    border: none; background: none; font-family: inherit;
}
.auth-tab.active {
    background: var(--white);
    color: var(--navy); font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
    font-size: .8rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px;
}
.form-control {
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: .95rem; color: var(--text);
    background: var(--white);
    transition: var(--transition); outline: none;
    font-family: 'Inter', sans-serif;
    width: 100%;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245,166,35,.15);
}
.form-control::placeholder { color: #C0C7D2; }
.form-control.error { border-color: var(--danger); }

.input-group { position: relative; }
.input-group .form-control { padding-left: 44px !important; }
.input-group .form-control[type="password"], 
.input-group .form-control.has-toggle { padding-right: 44px !important; }
.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; z-index: 2;
    display: flex; align-items: center;
}
.input-icon svg { display: block; }
.toggle-password {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); cursor: pointer; z-index: 2;
    background: none; border: none; padding: 4px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
    line-height: 1;
}
.toggle-password:hover { color: var(--navy); background: var(--bg); }
.toggle-password svg { display: block; }

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

/* Error message */
.field-error {
    font-size: .78rem; color: var(--danger);
    display: none;
}
.field-error.show { display: block; }

/* Alert */
.auth-alert {
    padding: 12px 16px; border-radius: 10px;
    font-size: .875rem; font-weight: 500;
    display: none; align-items: center; gap: 10px;
}
.auth-alert.show { display: flex; }
.auth-alert.error   { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.auth-alert.success { background: #ECFDF5; color: #065F46; border: 1px solid #6EE7B7; }

/* Submit Button */
.btn-auth {
    padding: 14px;
    background: var(--navy);
    color: var(--white);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem; font-weight: 700;
    border: none; border-radius: 10px;
    cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    letter-spacing: .3px;
    margin-top: 4px;
}
.btn-auth:hover {
    background: var(--primary);
    color: var(--navy);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(245,166,35,.3);
}
.btn-auth:disabled {
    opacity: .6; cursor: not-allowed; transform: none;
}
.btn-auth .spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: var(--white);
    animation: spin .6s linear infinite;
    display: none;
}
.btn-auth.loading .spinner { display: block; }
.btn-auth.loading .btn-text { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.auth-divider {
    text-align: center; position: relative; margin: 4px 0;
    color: var(--text-muted); font-size: .8rem;
}
.auth-divider::before {
    content: ''; position: absolute; top: 50%; left: 0; right: 0;
    height: 1px; background: var(--border);
}
.auth-divider span {
    position: relative; background: var(--white); padding: 0 12px;
}

/* Footer link */
.auth-footer {
    text-align: center; margin-top: 20px;
    font-size: .875rem; color: var(--text-muted);
}
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* Back link */
.back-link {
    text-align: center; margin-top: 16px;
}
.back-link a {
    color: rgba(255,255,255,.6); font-size: .875rem;
    display: inline-flex; align-items: center; gap: 6px;
    transition: var(--transition);
}
.back-link a:hover { color: var(--primary); }

@media (max-width: 480px) {
    .auth-card { padding: 28px 24px; border-radius: 20px; }
    .form-row { grid-template-columns: 1fr; }
}
