/* ==========================================================================
   PORTAL LOGIN & AUTHENTICATION - POHON KELUARGA
   Aesthetic: Luxury Emerald & Gold Glassmorphism, Responsive Mobile & Desktop
   ========================================================================== */

:root {
    --color-green-950: #051a11;
    --color-green-900: #0a2f1d;
    --color-green-800: #103b29;
    --color-green-700: #194f38;
    --color-green-600: #246d4e;
    --color-green-500: #338a64;
    --color-green-400: #48a97e;
    --color-green-200: #9dd8bd;
    --color-green-100: #cbeada;
    --color-green-50:  #ebf7f1;

    --color-gold-500: #c59b27;
    --color-gold-400: #ddb242;
    --color-gold-300: #f0ce71;

    --color-maroon-700: #8b1528;
    --color-maroon-800: #6b0f1e;
    --color-maroon-50:  #fdf2f4;

    --text-primary: #11261d;
    --text-secondary: #4a5d54;
    --text-muted: #768a80;

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-glass: 0 20px 50px rgba(0, 0, 0, 0.35);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--color-green-950);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
}

/* Ambient Background Lights */
.bg-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-circle-1 {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(36, 109, 78, 0.35) 0%, rgba(5, 26, 17, 0) 70%);
    top: -150px;
    left: -150px;
}

.ambient-circle-2 {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197, 155, 39, 0.2) 0%, rgba(5, 26, 17, 0) 70%);
    bottom: -100px;
    right: -100px;
}

/* SVG Vector Icon Utility */
.svg-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Main Auth Layout Container */
.auth-page-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1080px;
    background: rgba(16, 59, 41, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    overflow: hidden;
    animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Left Hero / Brand Section */
.auth-hero-section {
    padding: 48px 40px;
    background: linear-gradient(145deg, rgba(10, 47, 29, 0.9), rgba(5, 26, 17, 0.95));
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero-brand-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.brand-crest-box {
    width: 48px;
    height: 48px;
    background: #ffffff;
    border: 2px solid var(--color-gold-400);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    flex-shrink: 0;
}

.login-brand-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-title-wrap h1 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.brand-title-wrap p {
    font-size: 0.76rem;
    color: var(--color-gold-300);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hero-content h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1.25;
    color: #ffffff;
    margin-bottom: 12px;
}

.hero-content h2 span {
    color: var(--color-gold-400);
}

.hero-content p {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--color-green-100);
    margin-bottom: 28px;
}

.hero-features-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.feature-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gold-300);
}

.feature-text h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
}

.feature-text p {
    font-size: 0.78rem;
    color: var(--color-green-200);
    margin-bottom: 0;
    line-height: 1.4;
}

.hero-footer {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    color: var(--color-green-300);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Right Form Card Section */
.auth-form-section {
    padding: 44px 36px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header {
    margin-bottom: 20px;
}

.form-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-green-900);
    margin-bottom: 4px;
}

.form-header p {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

/* Alert Box */
.auth-alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 14px;
    display: none;
    line-height: 1.4;
}

.auth-alert.error {
    background: var(--color-maroon-50);
    border: 1px solid var(--color-maroon-600);
    color: var(--color-maroon-800);
    display: block;
}

.auth-alert.success {
    background: var(--color-green-50);
    border: 1px solid var(--color-green-600);
    color: var(--color-green-900);
    display: block;
}

/* Google Sign-In Button */
.btn-google {
    width: 100%;
    padding: 11px 16px;
    background: #ffffff;
    border: 1.5px solid #d8dfdb;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-google:hover {
    background: var(--color-green-50);
    border-color: var(--color-green-500);
    box-shadow: var(--shadow-card);
    transform: translateY(-1px);
}

.google-icon-svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e1e7e4;
}

.auth-divider span {
    padding: 0 12px;
}

/* Tab Switcher */
.auth-tabs {
    display: flex;
    background: var(--color-green-50);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid #dce8e2;
    margin-bottom: 16px;
}

.auth-tab-btn {
    flex: 1;
    padding: 7px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab-btn.active {
    background: var(--color-green-800);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 59, 41, 0.3);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.input-icon-wrap {
    position: relative;
    width: 100%;
}

.input-icon-wrap .svg-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 17px;
    height: 17px;
}

.input-icon-wrap input {
    width: 100%;
    padding: 9px 12px 9px 38px;
    border: 1.5px solid #d8dfdb;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.86rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.input-icon-wrap input:focus {
    border-color: var(--color-green-600);
    box-shadow: 0 0 0 3px rgba(36, 109, 78, 0.18);
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--color-green-800), var(--color-green-900));
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 59, 41, 0.35);
}

.btn-submit:hover {
    background: linear-gradient(135deg, var(--color-maroon-700), var(--color-maroon-800));
    box-shadow: 0 6px 16px rgba(139, 21, 40, 0.4);
    transform: translateY(-1px);
}

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

/* Guest Link */
.guest-link-wrap {
    margin-top: 14px;
    text-align: center;
}

.btn-guest-link {
    background: none;
    border: none;
    color: var(--color-green-700);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.btn-guest-link:hover {
    color: var(--color-maroon-700);
}

/* ==========================================================================
   RESPONSIVE DESIGN (HP & TABLET)
   ========================================================================== */

@media (max-width: 820px) {
    body {
        padding: 12px;
        align-items: flex-start;
    }

    .auth-page-wrapper {
        grid-template-columns: 1fr;
        border-radius: var(--radius-md);
        margin: 10px 0;
    }

    .auth-hero-section {
        padding: 28px 20px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .hero-content h2 {
        font-size: 1.45rem;
    }

    .hero-content p {
        font-size: 0.84rem;
        margin-bottom: 16px;
    }

    .hero-features-list {
        gap: 10px;
    }

    .auth-form-section {
        padding: 28px 20px;
    }

    .form-header h3 {
        font-size: 1.25rem;
    }
}

/* PWA Toast Styles for Login Page */
.pwa-network-toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    z-index: 2000;
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
}

.pwa-network-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pwa-network-toast.offline-state {
    background: #8b1528;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.pwa-network-toast.online-state {
    background: #19523a;
    color: #ffffff;
    border: 1px solid var(--color-green-400);
}

