/* =========================================================
   FM HAIRSTYLE — ADMIN LOGIN
   GLOBAL RESET & VARIABLES
========================================================== */

:root {
    --fm-black:            #120F10;
    --fm-black-soft:       #1c1819;
    --fm-black-line:       #2a2325;

    --fm-ivory:            #F8F1EC;
    --fm-ivory-muted:      rgba(248, 241, 236, 0.62);
    --fm-ivory-faint:      rgba(248, 241, 236, 0.38);

    --fm-dusty-pink:       #D96A8A;
    --fm-dusty-pink-dark:  #C45A7A;

    --fm-rose-gold:        #D98C6B;
    --fm-rose-gold-light:  #E8A88A;
    --fm-gold:             #d8b77a;
    --fm-gold-deep:        #8f7040;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------------------------------------------------------
   VIEWPORT ROOT
   Height calculation lives on body only. This gives us
   one place to control mobile viewport behaviour.
--------------------------------------------------------- */
html,
body {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    overflow-x: clip;
}

html {
    min-height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: #FFFEF2;
    color: var(--fm-ivory);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 1.5rem;

    /* Fallback for older browsers */
    min-height: 100vh;

    /* Dynamic viewport height — handles mobile browser bars */
    min-height: 100dvh;
}

/* =========================================================
   LOGIN CARD
========================================================== */
.login-card {
    display: flex;
    width: 100%;
    max-width: 1020px;
    min-height: 580px;
    background: var(--fm-black-soft);

    /* Faint gold hairline around the whole card */
    border: 1px solid rgba(216, 183, 122, 0.28);

    border-radius: 32px;
    overflow: hidden;

    /* Soft warm shadow tuned for the cream canvas */
    box-shadow:
        0 25px 70px rgba(60, 40, 20, 0.18),
        0 6px 20px  rgba(60, 40, 20, 0.08);

    position: relative;
}

/* Inner gold ring, one pixel inside the card edge */
.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(216, 183, 122, 0.12);
    z-index: 3;
}

/* =========================================================
   LEFT PANEL (IMAGE / BRAND)
========================================================== */
.login-brand {
    flex: 0 0 45%;
    background: var(--fm-black-soft);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.8rem 2.5rem;
    overflow: hidden;
}

.login-brand::before {
    content: "";
    position: absolute;
    inset: 0;

    background-image: url('/img/fm-hairstyle-admin-hero.jpg');
    background-size: cover;
    background-position: center 30%;

    opacity: 0.35;
    z-index: 0;
}

.login-brand::after {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(0, 0, 0, 0.65) 50%,
        rgba(0, 0, 0, 0.95) 100%
    );

    z-index: 1;
}

/* =========================================================
   LEFT PANEL — CENTERED CONTENT COLUMN
========================================================== */
.login-brand-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

/* =========================================================
   FRAMED BLOCK — LOGO + TITLE + SUB
   Very faint thin gold border around the top three items.
   The badge is NOT inside this frame.
========================================================== */
.login-brand-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    /* Very faint thin gold outline */
    border: 1px solid rgba(216, 183, 122, 0.22);
    border-radius: 18px;

    /* Breathing room so items don't touch the border */
    padding: 28px 26px 26px;

    /* Constrain width so the frame looks intentional,
       not stretched edge to edge inside the 45% panel */
    width: 100%;
    max-width: 300px;

    /* Soft inner lift so the frame reads as a card */
    background: rgba(0, 0, 0, 0.18);

    /* Nudge the badge below to sit a comfortable distance away */
    margin-bottom: 22px;
}

.login-brand-logo {
    width: 120px;
    max-height: 120px;
    object-fit: contain;
    margin-bottom: 1.5rem;
}

.login-brand-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 0.6rem;
    letter-spacing: -0.5px;
}

.login-brand-title .highlight {
    background: linear-gradient(
        135deg,
        var(--fm-gold) 0%,
        #e8c46a 50%,
        var(--fm-gold) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
}

.login-brand-sub {
    font-size: 0.9rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    max-width: 240px;
    margin-bottom: 0;
}

/* =========================================================
   BADGE — OUTSIDE THE FRAME
========================================================== */
.login-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(216, 183, 122, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(216, 183, 122, 0.25);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    color: var(--fm-gold);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.login-brand-badge i {
    font-size: 0.65rem;
    opacity: 0.85;
}

/* =========================================================
   RIGHT PANEL (FORM)
========================================================== */
.login-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3.5rem;
    background: var(--fm-black-soft);
}

.login-form-header {
    margin-bottom: 2.2rem;
}

.login-form-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--fm-ivory);
    margin-bottom: 0.4rem;
    letter-spacing: -0.5px;
}

.login-form-header p {
    font-size: 0.95rem;
    color: var(--fm-ivory-muted);
    font-weight: 400;
}

/* =========================================================
   FORM ELEMENTS
========================================================== */
.form-group {
    margin-bottom: 1.3rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--fm-ivory-muted);
    margin-bottom: 0.4rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i.input-icon {
    position: absolute;
    left: 16px;
    color: var(--fm-rose-gold);
    font-size: 0.95rem;
    opacity: 0.65;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.9rem;
    border: 1.5px solid var(--fm-black-line);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--fm-ivory);
    background: #141011;
    transition: all 0.3s ease;
    outline: none;
}

.input-wrapper input::placeholder {
    color: rgba(248, 241, 236, 0.28);
    font-weight: 300;
    font-size: 0.9rem;
}

.input-wrapper input:focus {
    border-color: var(--fm-dusty-pink);
    background: #181314;
    box-shadow: 0 0 0 4px rgba(217, 106, 138, 0.15);
}

.input-wrapper input:focus ~ i.input-icon {
    opacity: 1;
}

/* =========================================================
   PASSWORD TOGGLE
========================================================== */
.password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--fm-ivory);
    opacity: 0.5;
    cursor: pointer;
    padding: 6px 8px;
    font-size: 0.95rem;
    transition: opacity 0.3s ease;
    border-radius: 6px;
}

.password-toggle:hover {
    opacity: 0.9;
    background: rgba(217, 106, 138, 0.08);
}

/* =========================================================
   FORM OPTIONS (REMEMBER + FORGOT)
========================================================== */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.8rem;
    flex-wrap: wrap;
    gap: 8px;
}

.remember-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--fm-ivory-muted);
    cursor: pointer;
    user-select: none;
}

.remember-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--fm-dusty-pink);
    cursor: pointer;
    border-radius: 4px;
}

.forgot-link {
    font-size: 0.88rem;
    color: var(--fm-rose-gold);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--fm-gold);
    text-decoration: underline;
}

/* =========================================================
   SUBMIT BUTTON
========================================================== */
.btn-login {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--fm-dusty-pink);
    color: var(--fm-black);
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    background: var(--fm-dusty-pink-dark);
    color: var(--fm-ivory);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(217, 106, 138, 0.35);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    transition: transform 0.3s ease;
}

.btn-login:hover i {
    transform: translateX(4px);
}

/* =========================================================
   ERROR / SUCCESS ALERTS
========================================================== */
.alert-box {
    display: none;
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    font-size: 0.88rem;
    margin-bottom: 1.3rem;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.alert-box.show {
    display: flex;
}

.alert-error {
    background: rgba(217, 106, 138, 0.12);
    border: 1px solid rgba(217, 106, 138, 0.35);
    color: #f5c2d0;
}

.alert-error i {
    color: var(--fm-dusty-pink);
    font-size: 1rem;
}

.alert-success {
    background: rgba(216, 183, 122, 0.12);
    border: 1px solid rgba(216, 183, 122, 0.35);
    color: #f2e0bd;
}

.alert-success i {
    color: var(--fm-gold);
    font-size: 1rem;
}

/* =========================================================
   FOOTER NOTE
========================================================== */
.login-footer-note {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.78rem;
    color: var(--fm-ivory-faint);
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.login-footer-note i {
    color: var(--fm-gold);
    margin-right: 6px;
}

/* =========================================================
   BACK TO SITE
========================================================== */
.back-to-site {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--fm-rose-gold);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.back-to-site:hover {
    color: var(--fm-gold);
    gap: 12px;
}

.back-to-site i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.back-to-site:hover i {
    transform: translateX(-3px);
}

/* =========================================================
   RESPONSIVE — TABLET (991px and below)
========================================================== */
@media (max-width: 991px) {
    .login-card {
        flex-direction: column;
        max-width: 520px;
        min-height: auto;
        border-radius: 24px;
    }

    .login-brand {
        flex: 0 0 auto;
        min-height: 260px;
        padding: 2rem 2rem 1.8rem;
        justify-content: center;
        align-items: center;
        border-radius: 24px 24px 0 0;
    }

    .login-brand::before {
        background-position: center 40%;
    }

    .login-brand::after {
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.6) 40%,
            rgba(0, 0, 0, 0.95) 100%
        );
    }

    .login-brand-frame {
        max-width: 280px;
        padding: 22px 22px 20px;
        margin-bottom: 18px;
    }

    .login-brand-logo {
        width: 90px;
        max-height: 90px;
        margin-bottom: 1rem;
    }

    .login-brand-title {
        font-size: 1.7rem;
    }

    .login-brand-sub {
        font-size: 0.82rem;
        max-width: 100%;
        margin-bottom: 0;
    }

    .login-brand-badge {
        font-size: 0.6rem;
        padding: 0.3rem 1rem;
    }

    .login-form-panel {
        padding: 2.2rem 2rem;
        border-radius: 0 0 24px 24px;
    }

    .login-form-header h2 {
        font-size: 1.7rem;
    }
}

/* =========================================================
   RESPONSIVE — SMALL PHONES (576px and below)

   Keep the floating card design.
   Use "safe center" so the card is vertically centred
   when there is room, but never pushed off-screen when
   the phone is too short.
========================================================== */
@media (max-width: 576px) {
    body {
        padding: 1.5rem 0.8rem;

        align-items: safe center;
        justify-content: center;

        min-height: 100vh;
        min-height: 100dvh;
    }

    .login-card {
        border-radius: 20px;
        max-width: 100%;
    }

    .login-brand {
        min-height: 220px;
        padding: 1.5rem 1.5rem 1.3rem;
        justify-content: center;
        align-items: center;
        border-radius: 20px 20px 0 0;
    }

    .login-brand-frame {
        max-width: 240px;
        padding: 18px 18px 16px;
        margin-bottom: 14px;
        border-radius: 14px;
    }

    .login-brand-logo {
        width: 70px;
        max-height: 70px;
        margin-bottom: 0.8rem;
    }

    .login-brand-title {
        font-size: 1.4rem;
    }

    .login-brand-sub {
        font-size: 0.75rem;
        margin-bottom: 0;
    }

    .login-brand-badge {
        font-size: 0.55rem;
        padding: 0.25rem 0.8rem;
        letter-spacing: 1px;
    }

    .login-form-panel {
        padding: 1.8rem 1.5rem;
        border-radius: 0 0 20px 20px;
    }

    .login-form-header h2 {
        font-size: 1.5rem;
    }

    .login-form-header p {
        font-size: 0.85rem;
    }

    .input-wrapper input {
        padding: 0.8rem 0.9rem 0.8rem 2.6rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .input-wrapper i.input-icon {
        left: 14px;
        font-size: 0.85rem;
    }

    .password-toggle {
        right: 10px;
        font-size: 0.85rem;
        padding: 5px 6px;
    }

    .form-options {
        margin-bottom: 1.5rem;
    }

    .remember-check {
        font-size: 0.82rem;
    }

    .forgot-link {
        font-size: 0.82rem;
    }

    .btn-login {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .login-footer-note {
        font-size: 0.7rem;
        margin-top: 1.5rem;
    }

    .back-to-site {
        font-size: 0.8rem;
        margin-top: 1.2rem;
    }
}

/* =========================================================
   IPHONE SAFE AREA SUPPORT
   Only adjusts padding — never the design.
========================================================== */
@supports (padding: env(safe-area-inset-top)) {
    @media (max-width: 576px) {
        body {
            padding-top: max(
                1.5rem,
                env(safe-area-inset-top)
            );

            padding-bottom: max(
                1.5rem,
                env(safe-area-inset-bottom)
            );
        }
    }
}

/* =========================================================
   ANIMATIONS
========================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeInUp 0.7s ease forwards;
}

.login-form-panel {
    animation: fadeInUp 0.7s ease 0.15s both;
}