/* ========================================
   PBPMD Auth Design System
   ======================================== */
:root {
    --green-50: #f0fdf4; --green-100: #dcfce7; --green-200: #bbf7d0;
    --green-500: #22c55e; --green-600: #16a34a; --green-700: #15803d;
    --green-800: #166534; --green-900: #14532d; --green-950: #0a2e15;
    --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb;
    --gray-300: #d1d5db; --gray-400: #9ca3af; --gray-500: #6b7280;
    --gray-600: #4b5563; --gray-700: #374151; --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff; --danger: #ef4444; --radius: 12px; --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --transition: all .2s cubic-bezier(.4,0,.2,1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--gray-50); color: var(--gray-800); min-height: 100vh; }

/* Layout */
.auth-container { display: flex; min-height: 100vh; }
.auth-sidebar {
    width: 42%; max-width: 520px; background: linear-gradient(175deg, var(--green-800) 0%, var(--green-950) 100%);
    color: var(--white); padding: 2.5rem; display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; height: 100vh; overflow: hidden; z-index: 10;
}
.auth-main {
    flex: 1; display: flex; flex-direction: column; justify-content: flex-start;
    padding: 2.5rem 4rem; overflow-y: auto; background: var(--white);
    margin-left: min(42%, 520px); height: 100vh;
}

/* Sidebar */
.sidebar-content { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; }
.sidebar-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2.5rem; }
.brand-icon {
    width: 48px; height: 48px; background: rgba(255,255,255,.15); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px);
}
.brand-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.brand-subtitle { font-size: .8rem; opacity: .7; margin-top: 2px; font-weight: 400; letter-spacing: .03em; }

/* Hero Image */
.sidebar-hero { flex: 1; display: flex; align-items: center; justify-content: center; }
.hero-image-wrapper {
    position: relative; width: 100%; max-width: 380px; border-radius: var(--radius);
    overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,.3);
}
.hero-image { width: 100%; height: auto; display: block; object-fit: cover; aspect-ratio: 4/3; }
.hero-badge {
    position: absolute; bottom: 1rem; left: 1rem; background: rgba(0,0,0,.55);
    backdrop-filter: blur(12px); color: var(--white); padding: .5rem 1rem;
    border-radius: 999px; font-size: .78rem; font-weight: 500;
    display: flex; align-items: center; gap: .5rem;
}

/* Floating dots */
.floating-dots { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.dot {
    position: absolute; border-radius: 50%; background: rgba(255,255,255,.12);
    animation: float 6s ease-in-out infinite;
}
.dot-1 { width: 12px; height: 12px; top: 35%; right: 15%; animation-delay: 0s; }
.dot-2 { width: 8px; height: 8px; top: 55%; right: 30%; animation-delay: 2s; }
.dot-3 { width: 10px; height: 10px; top: 70%; right: 10%; animation-delay: 4s; }
@keyframes float {
    0%, 100% { transform: translateY(0); opacity: .4; }
    50% { transform: translateY(-18px); opacity: .8; }
}

/* Quote */
.sidebar-quote { margin-top: auto; padding-top: 2rem; }
.quote-mark { font-size: 2.5rem; font-weight: 800; color: var(--green-500); line-height: 1; display: block; margin-bottom: .5rem; }
.sidebar-quote blockquote { font-size: .95rem; line-height: 1.7; opacity: .9; font-style: italic; }
.sidebar-quote cite { display: block; margin-top: .75rem; font-size: .82rem; opacity: .6; font-style: normal; }

/* Auth Form Area */
.auth-form-wrapper { max-width: 480px; width: 100%; margin: 0 auto; }
.auth-badge {
    display: inline-flex; align-items: center; gap: .4rem; background: var(--green-50);
    color: var(--green-700); padding: .35rem .9rem; border-radius: 999px;
    font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    margin-bottom: 1rem;
}
.auth-badge-dot { width: 7px; height: 7px; background: var(--green-500); border-radius: 50%; }
.auth-title { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); letter-spacing: -.02em; }
.auth-subtitle { color: var(--gray-500); font-size: .9rem; line-height: 1.6; margin-top: .5rem; margin-bottom: 2rem; }

/* Form Groups */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--gray-700); margin-bottom: .4rem; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-hint { font-size: .75rem; color: var(--gray-400); margin-top: .3rem; display: flex; align-items: center; gap: .3rem; }

/* Input */
.input-wrapper {
    position: relative; display: flex; align-items: center;
    border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
    background: var(--white); transition: var(--transition);
}
.input-wrapper:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.input-wrapper.is-error { border-color: var(--danger); }
.input-icon {
    position: absolute; left: .9rem; color: var(--gray-400); display: flex;
    align-items: center; pointer-events: none;
}
.form-input {
    width: 100%; padding: .75rem .9rem .75rem 2.75rem; border: none; outline: none;
    font-size: .9rem; font-family: inherit; color: var(--gray-800); background: transparent;
}
.form-input::placeholder { color: var(--gray-400); }
.toggle-password {
    position: absolute; right: .9rem; background: none; border: none; color: var(--gray-400);
    cursor: pointer; display: flex; padding: .25rem; transition: var(--transition);
}
.toggle-password:hover { color: var(--gray-600); }

/* Select */
.form-select {
    width: 100%; padding: .75rem .9rem; border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm); font-size: .9rem; font-family: inherit;
    color: var(--gray-800); background: var(--white); cursor: pointer;
    appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .75rem center;
    transition: var(--transition);
}
.form-select:focus { border-color: var(--green-500); outline: none; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }

/* Row layout */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Phone input */
.phone-wrapper { display: flex; gap: 0; }
.phone-prefix {
    padding: .75rem .7rem; border: 1.5px solid var(--gray-200); border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--gray-50);
    font-size: .85rem; color: var(--gray-600); font-weight: 500; white-space: nowrap;
}
.phone-wrapper .form-input {
    border: 1.5px solid var(--gray-200); border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding-left: .7rem;
}
.phone-wrapper .form-input:focus { border-color: var(--green-500); outline: none; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }

/* Remember & Forgot */
.form-extras { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.checkbox-wrapper { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.checkbox-wrapper input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--green-600); cursor: pointer;
}
.checkbox-wrapper span { font-size: .82rem; color: var(--gray-600); }
.forgot-link { font-size: .82rem; color: var(--green-600); text-decoration: none; font-weight: 500; transition: var(--transition); }
.forgot-link:hover { color: var(--green-700); text-decoration: underline; }

/* Buttons */
.btn-primary {
    width: 100%; padding: .85rem 1.5rem; background: linear-gradient(135deg, var(--green-700), var(--green-800));
    color: var(--white); border: none; border-radius: var(--radius-sm); font-size: .95rem;
    font-weight: 600; font-family: inherit; cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    box-shadow: 0 2px 8px rgba(22,101,52,.3);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--green-800), var(--green-950)); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(22,101,52,.4); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
    padding: .65rem 1.2rem; background: var(--white); color: var(--green-700);
    border: 1.5px solid var(--green-600); border-radius: var(--radius-sm); font-size: .85rem;
    font-weight: 600; font-family: inherit; cursor: pointer; transition: var(--transition);
    text-decoration: none; display: inline-block; text-align: center;
}
.btn-outline:hover { background: var(--green-50); }

/* Divider */
.divider { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.divider span { font-size: .82rem; color: var(--gray-400); white-space: nowrap; }

/* Alt action box */
.alt-action {
    display: flex; align-items: center; justify-content: space-between;
    border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
    padding: 1rem 1.25rem; margin-bottom: 1rem;
}
.alt-action-text h4 { font-size: .9rem; font-weight: 600; color: var(--gray-800); }
.alt-action-text p { font-size: .78rem; color: var(--gray-500); margin-top: .15rem; }

/* Help box */
.help-box {
    display: flex; align-items: center; gap: .5rem; border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .82rem; color: var(--gray-500);
}
.help-box a { color: var(--green-600); text-decoration: none; font-weight: 500; }
.help-box a:hover { text-decoration: underline; }

/* Section cards (register) */
.section-card {
    border: 1.5px solid var(--gray-200); border-radius: var(--radius); padding: 1.5rem;
    margin-bottom: 1.25rem; background: var(--white);
}
.section-title {
    display: flex; align-items: center; gap: .5rem; font-size: .95rem;
    font-weight: 600; color: var(--gray-800); margin-bottom: 1.25rem;
}

/* Info banner */
.info-banner {
    background: var(--green-50); border: 1px solid var(--green-200); border-radius: var(--radius-sm);
    padding: .75rem 1rem; font-size: .8rem; color: var(--green-800);
    display: flex; align-items: center; gap: .5rem; margin-bottom: 1.5rem;
}

/* Step indicator */
.step-indicator { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-bottom: 2rem; }
.step {
    display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 500; color: var(--gray-400);
}
.step.active { color: var(--green-700); }
.step-num {
    width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; border: 2px solid var(--gray-300); color: var(--gray-400);
}
.step.active .step-num { background: var(--green-700); color: var(--white); border-color: var(--green-700); }
.step-line { width: 60px; height: 2px; background: var(--gray-200); }

/* Checkbox (terms) */
.terms-group { margin-bottom: 1.5rem; }
.terms-checkbox { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .6rem; cursor: pointer; }
.terms-checkbox input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--green-600); flex-shrink: 0; }
.terms-checkbox span { font-size: .8rem; color: var(--gray-600); line-height: 1.5; }
.terms-checkbox a { color: var(--green-600); text-decoration: underline; }

/* Cancel link */
.cancel-link {
    display: block; text-align: center; margin-top: .75rem; font-size: .85rem;
    color: var(--gray-500); text-decoration: none; font-weight: 500;
}
.cancel-link:hover { color: var(--gray-700); }

/* Bottom link */
.bottom-link { text-align: center; margin-top: 1.25rem; font-size: .85rem; color: var(--gray-500); }
.bottom-link a { color: var(--green-600); text-decoration: none; font-weight: 600; }
.bottom-link a:hover { text-decoration: underline; }

/* Error */
.form-error { color: var(--danger); font-size: .78rem; margin-top: .3rem; display: flex; align-items: center; gap: .3rem; }
.alert-error {
    background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-sm);
    padding: .75rem 1rem; margin-bottom: 1.25rem; color: #991b1b; font-size: .85rem;
}
.alert-success {
    background: var(--green-50); border: 1px solid var(--green-200); border-radius: var(--radius-sm);
    padding: .75rem 1rem; margin-bottom: 1.25rem; color: var(--green-800); font-size: .85rem;
}

/* Footer */
.auth-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 2rem; margin-top: auto; font-size: .78rem; color: var(--gray-400);
}
.footer-links { display: flex; align-items: center; gap: .5rem; }
.footer-links a { color: var(--gray-400); text-decoration: none; transition: var(--transition); }
.footer-links a:hover { color: var(--gray-600); }
.footer-divider { color: var(--gray-300); }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .auth-main { padding: 2rem; }
}
@media (max-width: 768px) {
    .auth-container { flex-direction: column; }
    .auth-sidebar { width: 100%; max-width: 100%; padding: 1.25rem; position: relative; height: auto; }
    .auth-main { margin-left: 0; height: auto; padding: 1.5rem; }
    .sidebar-hero { display: none; }
    .sidebar-quote { display: none; }
    .sidebar-header { margin-bottom: 0; }
    .auth-footer { flex-direction: column; gap: .5rem; text-align: center; }
    .form-row { grid-template-columns: 1fr; }
    .auth-title { font-size: 1.35rem; }
    .auth-subtitle { font-size: .82rem; margin-bottom: 1.5rem; }
    .alt-action { flex-direction: column; gap: .75rem; text-align: center; }
    .step-line { width: 30px; }
}
@media (max-width: 480px) {
    .auth-sidebar { padding: 1rem; }
    .auth-main { padding: 1rem; }
    .auth-title { font-size: 1.15rem; }
    .brand-title { font-size: 1.1rem; }
    .btn-primary { font-size: .88rem; padding: .75rem 1.25rem; }
    .form-input { font-size: .85rem; padding: .65rem .75rem .65rem 2.5rem; }
}
