/* =============================================
   HERBALMED EXPERT — AUTH CSS
   ============================================= */

:root {
    --green-900: #0d2518;
    --green-800: #1a3d2b;
    --green-700: #2d6a4f;
    --green-600: #40916c;
    --green-500: #52b788;
    --green-400: #74c69d;
    --green-300: #95d5b2;
    --green-100: #d8f3dc;
    --green-50: #f0faf3;
    --gold: #d4a853;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-400: #a1a1aa;
    --gray-600: #52525b;
    --gray-800: #27272a;
    --red-100: #fee2e2;
    --red-600: #dc2626;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --shadow-md: 0 4px 20px rgba(0,0,0,.12);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--font-body); background: var(--gray-50); overflow-x: hidden; }

/* ── LOADING OVERLAY ── */
.loading-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(13, 37, 24, 0.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.3s, visibility 0.3s;
}
.loading-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-box {
    background: white; border-radius: var(--radius-lg); padding: 40px 48px;
    text-align: center; box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.loading-spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--green-100);
    border-top-color: var(--green-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-box p { color: var(--gray-600); font-weight: 500; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── AUTH WRAPPER ── */
.auth-wrapper {
    min-height: 100vh;
    display: grid; grid-template-columns: 1fr 1fr;
}

/* ── LEFT PANEL ── */
.auth-left {
    background: linear-gradient(160deg, var(--green-900) 0%, var(--green-800) 60%, var(--green-700) 100%);
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    padding: 48px;
}
.auth-left-inner { position: relative; z-index: 1; max-width: 420px; }
.auth-brand {
    display: flex; align-items: center; gap: 12px;
    color: white; font-size: 1.2rem; font-weight: 700; margin-bottom: 60px;
}
.auth-brand .brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--green-500), var(--green-600));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: white;
    box-shadow: 0 4px 15px rgba(82,183,136,.4);
}
.auth-hero-text h1 {
    font-size: 2.8rem; font-weight: 800; color: white;
    line-height: 1.15; margin-bottom: 16px;
}
.auth-hero-text p { color: rgba(255,255,255,.7); font-size: 1.05rem; line-height: 1.7; margin-bottom: 36px; }
.auth-features { display: flex; flex-direction: column; gap: 12px; }
.auth-feat { display: flex; align-items: center; gap: 12px; }
.auth-feat i { color: var(--green-400); font-size: 1rem; }
.auth-feat span { color: rgba(255,255,255,.75); font-size: 0.95rem; }

/* Decorations */
.auth-decoration { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.deco-circle {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06);
}
.c1 { width: 400px; height: 400px; top: -100px; right: -150px; }
.c2 { width: 250px; height: 250px; bottom: -50px; left: -80px; }
.c3 { width: 150px; height: 150px; top: 40%; right: 20px; }
.deco-leaf {
    position: absolute; color: rgba(82,183,136,.15); font-size: 8rem;
    top: 10%; right: -10px; transform: rotate(-30deg);
    animation: leafSway 6s ease-in-out infinite;
}
.dl2 { top: auto; bottom: 15%; right: 30px; font-size: 5rem; animation-delay: -3s; }
@keyframes leafSway {
    0%,100% { transform: rotate(-30deg) translateY(0); }
    50% { transform: rotate(-25deg) translateY(-15px); }
}

/* ── RIGHT PANEL ── */
.auth-right {
    display: flex; align-items: center; justify-content: center;
    padding: 48px 32px;
    background: white;
}
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-form-header { margin-bottom: 32px; }
.auth-form-header h2 { font-size: 1.9rem; font-weight: 800; color: var(--gray-800); margin-bottom: 8px; }
.auth-form-header p { color: var(--gray-600); font-size: 0.95rem; }
.auth-form-header a { color: var(--green-600); text-decoration: none; font-weight: 600; }
.auth-form-header a:hover { text-decoration: underline; }

/* ALERTS */
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-radius: var(--radius-md);
    font-size: 0.9rem; font-weight: 500; margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}
.alert-error { background: var(--red-100); color: var(--red-600); border: 1px solid #fca5a5; }
.alert-success { background: var(--green-100); color: var(--green-700); border: 1px solid var(--green-300); }
@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }

/* FORM */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.875rem; font-weight: 600; color: var(--gray-700, #374151);
    margin-bottom: 8px;
}
.forgot-link { color: var(--green-600); text-decoration: none; font-weight: 500; font-size: 0.82rem; }
.forgot-link:hover { text-decoration: underline; }
.input-wrap { position: relative; }
.input-wrap > i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 0.95rem; pointer-events: none;
}
.input-wrap input {
    width: 100%; padding: 13px 14px 13px 42px;
    border: 2px solid var(--gray-200); border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: 0.95rem; color: var(--gray-800);
    background: var(--gray-50); transition: var(--transition);
    outline: none;
}
.input-wrap input:focus { border-color: var(--green-500); background: white; box-shadow: 0 0 0 4px rgba(82,183,136,.1); }
.input-wrap input::placeholder { color: var(--gray-400); }
.input-wrap .toggle-pw {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--gray-400); font-size: 0.9rem; padding: 4px;
    transition: var(--transition);
}
.input-wrap .toggle-pw:hover { color: var(--green-600); }

.form-group select {
    width: 100%; padding: 13px 14px 13px 42px;
    border: 2px solid var(--gray-200); border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: 0.95rem; color: var(--gray-800);
    background: var(--gray-50); transition: var(--transition);
    outline: none; appearance: none; cursor: pointer;
}
.form-group select:focus { border-color: var(--green-500); background: white; box-shadow: 0 0 0 4px rgba(82,183,136,.1); }

.form-group-check { margin-bottom: 24px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9rem; color: var(--gray-600); }
.checkbox-label input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green-600); cursor: pointer; }

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

.btn-submit {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--green-600), var(--green-700));
    color: white; border: none; border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 4px 20px rgba(45,106,79,.4);
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(45,106,79,.5); }
.btn-submit:active { transform: translateY(0); }

/* DEMO CARDS */
.auth-demo { margin-top: 28px; }
.demo-title {
    text-align: center; position: relative; margin-bottom: 16px;
    color: var(--gray-400); font-size: 0.8rem;
}
.demo-title::before, .demo-title::after {
    content: ''; position: absolute; top: 50%;
    width: calc(50% - 60px); height: 1px; background: var(--gray-200);
}
.demo-title::before { left: 0; }
.demo-title::after { right: 0; }
.demo-title span { background: white; padding: 0 12px; position: relative; z-index: 1; }
.demo-cards { display: flex; gap: 10px; margin-bottom: 10px; }
.demo-card {
    flex: 1; display: flex; align-items: center; gap: 10px;
    background: var(--gray-50); border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md); padding: 12px;
    cursor: pointer; transition: var(--transition); text-align: left;
}
.demo-card:hover { border-color: var(--green-400); background: var(--green-50); }
.demo-card i { font-size: 1.3rem; color: var(--green-600); }
.demo-card strong { display: block; font-size: 0.82rem; color: var(--gray-800); }
.demo-card small { display: block; font-size: 0.72rem; color: var(--gray-400); }
.demo-hint { font-size: 0.77rem; color: var(--gray-400); text-align: center; }
.demo-hint code { background: var(--gray-100); padding: 1px 6px; border-radius: 4px; font-size: 0.82rem; }

.auth-back { margin-top: 24px; text-align: center; }
.auth-back a { color: var(--gray-400); text-decoration: none; font-size: 0.875rem; transition: var(--transition); }
.auth-back a:hover { color: var(--green-600); }

.terms-text { font-size: 0.8rem; color: var(--gray-400); text-align: center; margin-top: 16px; }
.terms-text a { color: var(--green-600); text-decoration: none; }

/* PASSWORD STRENGTH */
.pw-strength { margin-top: 6px; }
.pw-strength-bar { height: 4px; background: var(--gray-200); border-radius: 2px; overflow: hidden; margin-bottom: 4px; }
.pw-strength-fill { height: 100%; width: 0; transition: width 0.3s, background 0.3s; border-radius: 2px; }
.pw-strength-text { font-size: 0.75rem; color: var(--gray-400); }

@media (max-width: 768px) {
    .auth-wrapper { grid-template-columns: 1fr; }
    .auth-left { display: none; }
    .auth-right { padding: 32px 20px; min-height: 100vh; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
}
