/* ============================================
   LOGIN — Mamatcha · Portrait Layout
   ============================================ */

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

:root {
    --cream-50:  #fdfaf5;
    --cream-100: #f9f3e8;
    --cream-200: #f2e8d5;
    --cream-300: #e8d9bc;
    --cream-400: #d4b896;

    --brown-900: #2c1a0e;
    --brown-800: #3d2512;
    --brown-700: #5c3d1e;
    --brown-600: #7a5230;
    --brown-500: #9a6b42;
    --brown-400: #b8895e;
    --brown-300: #d4a97a;
    --brown-200: #e8cba8;
    --brown-100: #f5e6d3;

    --gray-900: #1c1917;
    --gray-700: #44403c;
    --gray-500: #78716c;
    --gray-400: #a8a29e;
    --gray-200: #e7e5e4;
    --white:    #ffffff;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm:    0 1px 3px rgba(44,26,14,.07), 0 1px 2px rgba(44,26,14,.05);
    --shadow-md:    0 4px 16px rgba(44,26,14,.1),  0 2px 6px rgba(44,26,14,.06);
    --shadow-brown: 0 4px 20px rgba(122,82,48,.32);
}

html, body {
    height: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cream-100);
    color: var(--gray-900);
    -webkit-font-smoothing: antialiased;
    overflow-y: auto;
}

/* ============================================
   PAGE — portrait stack: image top, form bottom
   ============================================ */
.login-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   HERO — image section (top ~45vh)
   ============================================ */
.hero-section {
    position: relative;
    height: 45vh;
    min-height: 280px;
    max-height: 480px;
    overflow: hidden;
    flex-shrink: 0;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}

/* Dark-to-cream gradient overlay */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(44, 26, 14, 0.50) 0%,
        rgba(44, 26, 14, 0.15) 45%,
        rgba(249, 243, 232, 0.70) 85%,
        rgba(249, 243, 232, 1.00) 100%
    );
    z-index: 1;
}

/* Brand pill — centered top */
.hero-brand {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(253, 250, 245, 0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

.hero-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 7px;
}

.hero-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--brown-800);
    font-family: 'Playfair Display', serif;
    letter-spacing: -.2px;
    line-height: 1;
}

/* Quote — bottom of image, blends into form */
.hero-quote {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    white-space: nowrap;
}

.hero-quote span {
    font-size: 13px;
    font-style: italic;
    color: var(--brown-700);
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    opacity: .85;
}

/* ============================================
   FORM SECTION — bottom
   ============================================ */
.form-section {
    flex: 1;
    background: var(--cream-50);
    display: flex;
    justify-content: center;
    padding: 0 24px 48px;
    position: relative;
    /* Pull up slightly to overlap image bottom */
    margin-top: -32px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -4px 24px rgba(44,26,14,.08);
}

/* Dot texture */
.form-section::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: radial-gradient(var(--cream-300) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: .3;
    pointer-events: none;
}

.form-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding-top: 36px;
    animation: fadeUp .4s ease both;
}

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

/* ---- Heading ---- */
.form-heading {
    margin-bottom: 28px;
}

.form-heading h1 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--brown-900);
    letter-spacing: -.4px;
    margin-bottom: 5px;
    line-height: 1.2;
}

.form-heading p {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 400;
}

.form-heading::after {
    content: '';
    display: block;
    width: 36px;
    height: 3px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--brown-400), var(--brown-200));
    margin-top: 14px;
}

/* ---- Alerts ---- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13px;
    animation: slideIn .3s ease both;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alert strong {
    font-size: 13px;
    font-weight: 700;
    display: block;
}

.alert span {
    font-size: 12px;
    opacity: .8;
}

.alert-error {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
}

/* ---- Fields ---- */
.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--brown-700);
    margin-bottom: 7px;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.field-input {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 14px;
    color: var(--brown-300);
    pointer-events: none;
    transition: color .2s ease;
}

.field-input:focus-within .field-icon {
    color: var(--brown-500);
}

.field-input input {
    width: 100%;
    padding: 14px 44px;
    border: 1.5px solid var(--cream-300);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    background: var(--white);
    color: var(--gray-900);
    transition: all .2s ease;
    -webkit-appearance: none;
    box-shadow: var(--shadow-sm);
}

.field-input input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.field-input input:focus {
    outline: none;
    border-color: var(--brown-400);
    box-shadow: 0 0 0 3px rgba(212,169,122,.18);
}

/* Eye toggle */
.eye-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 5px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: color .2s ease, background .2s ease;
}

.eye-toggle:hover {
    color: var(--brown-600);
    background: var(--cream-100);
}

/* ---- Submit button ---- */
.btn-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 24px;
    margin-top: 8px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brown-800) 0%, var(--brown-600) 100%);
    color: var(--cream-50);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: var(--shadow-brown);
    position: relative;
    overflow: hidden;
    letter-spacing: .2px;
}

.btn-login::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity .25s ease;
}

.btn-login:hover::after { opacity: 1; }

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(122,82,48,.42);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: var(--shadow-brown);
}

.btn-login:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

.btn-arrow, .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.spin { animation: spin .75s linear infinite; }

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

/* ---- Hint ---- */
.form-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 20px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    background: var(--brown-100);
    border: 1px solid var(--cream-300);
    font-size: 13px;
    color: var(--brown-600);
}

.form-hint svg { flex-shrink: 0; color: var(--brown-500); }

.form-hint code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: var(--cream-200);
    color: var(--brown-800);
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 700;
}

/* ---- Footer ---- */
.form-footer {
    margin-top: 28px;
    font-size: 12px;
    color: var(--gray-400);
    text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Desktop — tetap portrait tapi lebih lebar */
@media (min-width: 768px) {
    .hero-section {
        height: 48vh;
        max-height: 520px;
    }

    .hero-brand {
        top: 36px;
        padding: 12px 24px;
    }

    .hero-logo { width: 34px; height: 34px; }
    .hero-name { font-size: 17px; }

    .hero-quote span { font-size: 14px; }

    .form-section {
        padding: 0 40px 56px;
        margin-top: -40px;
    }

    .form-inner {
        padding-top: 44px;
    }

    .form-heading h1 { font-size: 32px; }
}

/* Large desktop */
@media (min-width: 1200px) {
    .hero-section {
        height: 50vh;
        max-height: 560px;
    }

    .form-section {
        padding: 0 48px 64px;
    }
}

/* Mobile — compact */
@media (max-width: 480px) {
    .hero-section {
        height: 40vh;
        min-height: 240px;
    }

    .hero-brand {
        top: 20px;
        padding: 8px 16px;
        gap: 8px;
    }

    .hero-logo { width: 26px; height: 26px; }
    .hero-name { font-size: 14px; }

    .hero-quote { display: none; }

    .form-section {
        padding: 0 20px 40px;
        margin-top: -24px;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .form-inner { padding-top: 28px; }

    .form-heading h1 { font-size: 24px; }

    .field-input input {
        font-size: 16px; /* prevent iOS zoom */
        padding: 13px 44px;
    }

    .btn-login { padding: 14px 20px; }

    .form-footer { margin-top: 20px; }
}

/* Small mobile */
@media (max-width: 360px) {
    .hero-section {
        height: 36vh;
        min-height: 200px;
    }

    .form-section { padding: 0 16px 32px; }
    .form-inner   { padding-top: 24px; }
    .form-heading h1 { font-size: 22px; }
    .field { margin-bottom: 14px; }
}
