/* =========================
   EVENT MANAGEMENT LOGIN
========================= */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-main: #f8efe8;
    --bg-soft: #fffaf6;

    --brown: #8b5e3c;
    --brown-dark: #5f3d28;

    --gold: #c89b7b;
    --gold-dark: #a87c5f;
    --theme-soft: rgba(200,155,123,0.12);
    --theme-soft-strong: rgba(200,155,123,0.28);

    --text: #252525;
    --muted: #777;
    --line: rgba(139, 94, 60, 0.14);

    --red: #c0392b;
    --red-soft: rgba(192,57,43,0.10);

    --shadow: 0 35px 95px rgba(95,61,40,0.14);
    --surface-tint: rgba(255,250,246,0.90);
}

:root[data-admin-theme="rose_admin"] {
    --brown: #a76565;
    --brown-dark: #6f3d3d;
    --gold: #d8a7a7;
    --gold-dark: #a76565;
    --bg-main: #fbefef;
    --bg-soft: #fffafa;
    --theme-soft: rgba(216,167,167,0.12);
    --theme-soft-strong: rgba(216,167,167,0.28);
    --line: rgba(167,101,101,0.16);
    --shadow: 0 35px 95px rgba(111,61,61,0.14);
}

:root[data-admin-theme="sage_admin"] {
    --brown: #6f8262;
    --brown-dark: #3f5037;
    --gold: #9caf88;
    --gold-dark: #6f8262;
    --bg-main: #eef3e8;
    --bg-soft: #fbfff8;
    --theme-soft: rgba(156,175,136,0.12);
    --theme-soft-strong: rgba(156,175,136,0.28);
    --line: rgba(111,130,98,0.16);
    --shadow: 0 35px 95px rgba(63,80,55,0.14);
}

:root[data-admin-theme="navy_admin"] {
    --brown: #1f3a5f;
    --brown-dark: #14263d;
    --gold: #2f5f8f;
    --gold-dark: #1f3a5f;
    --bg-main: #eaf0f7;
    --bg-soft: #f8fbff;
    --theme-soft: rgba(31,58,95,0.12);
    --theme-soft-strong: rgba(31,58,95,0.28);
    --line: rgba(31,58,95,0.16);
    --shadow: 0 35px 95px rgba(20,38,61,0.14);
}

:root[data-admin-theme="dark_cocoa"] {
    --brown: #8b5e3c;
    --brown-dark: #3d281c;
    --gold: #b98a62;
    --gold-dark: #6b452f;
    --bg-main: #efe6df;
    --bg-soft: #fffaf6;
    --theme-soft: rgba(95,61,40,0.12);
    --theme-soft-strong: rgba(95,61,40,0.28);
    --line: rgba(95,61,40,0.16);
    --shadow: 0 35px 95px rgba(61,40,28,0.16);
}

body.login-portal-client {
    --bg-main: #e9eef3;
    --bg-soft: #f7f9fb;
    --brown: #49637c;
    --brown-dark: #203247;
    --gold: #587590;
    --gold-dark: #3d5871;
    --theme-soft: rgba(73,99,124,0.10);
    --theme-soft-strong: rgba(73,99,124,0.22);
    --text: #1f2933;
    --muted: #5f6f7f;
    --line: rgba(32,50,71,0.14);
    --shadow: 0 35px 95px rgba(32,50,71,0.14);
    --surface-tint: rgba(248,250,252,0.94);
}

/* =========================
   BASE
========================= */

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 20%, var(--theme-soft-strong), transparent 28%),
        radial-gradient(circle at 82% 78%, var(--theme-soft), transparent 30%),
        linear-gradient(180deg, var(--bg-soft) 0%, var(--bg-main) 100%);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* =========================
   PAGE
========================= */

.login-page {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 40px 18px;
    overflow: hidden;
}

.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255,255,255,0.40) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.40) 1px, transparent 1px);
    background-size: 54px 54px;
    opacity: 0.18;
    pointer-events: none;
}

/* Background glow */
.login-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(45px);
    pointer-events: none;
    opacity: 0.5;
    animation: loginOrbFloat 8s ease-in-out infinite alternate;
}

.orb-one {
    width: 320px;
    height: 320px;
    top: 12%;
    left: 8%;
    background: var(--theme-soft-strong);
}

.orb-two {
    width: 360px;
    height: 360px;
    right: 7%;
    bottom: 8%;
    background: var(--theme-soft);
    animation-delay: 1.2s;
}

/* =========================
   WRAPPER
========================= */

.login-wrapper {
    position: relative;
    z-index: 2;
    width: min(430px, 100%);
    animation: fadeIn 0.85s ease both;
}

/* =========================
   CARD
========================= */

.login-card {
    position: relative;
    padding: 46px 34px 34px;
    border-radius: 32px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), var(--surface-tint));
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    top: -90px;
    right: -90px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: var(--theme-soft);
    pointer-events: none;
}

.login-card::after {
    content: "";
    position: absolute;
    left: -100px;
    bottom: -110px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: var(--theme-soft);
    pointer-events: none;
}

.login-card-head,
.login-form,
.login-error {
    position: relative;
    z-index: 2;
}

/* =========================
   HEADER
========================= */

.login-card-head {
    text-align: center;
}

.login-brand-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 20px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 25px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    box-shadow: 0 18px 35px var(--theme-soft-strong);
}

.login-title {
    margin: 0;
    color: var(--brown-dark);
    font-size: 30px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.7px;
}

.login-subtitle {
    max-width: 330px;
    margin: 14px auto 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

/* =========================
   ERROR
========================= */

.login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 0;
    padding: 13px 14px;
    border-radius: 16px;
    background: var(--red-soft);
    color: var(--red);
    border: 1px solid rgba(192,57,43,0.12);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

.login-error p {
    margin: 0;
    line-height: 1.5;
}

/* =========================
   FORM
========================= */

.login-form {
    display: grid;
    gap: 18px;
    margin-top: 30px;
}

.login-field {
    display: grid;
    gap: 8px;
}

.login-field label {
    color: var(--brown-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.login-input-shell {
    position: relative;
}

.login-input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 2;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.75;
}

.login-input-shell input {
    width: 100%;
    min-height: 54px;
    padding: 15px 18px 15px 48px;
    border-radius: 18px;
    border: 1px solid var(--theme-soft-strong);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), var(--surface-tint));
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

.login-input-shell input::placeholder {
    color: #999;
}

.login-input-shell input:focus {
    border-color: var(--gold);
    background: rgba(255,255,255,0.98);
    box-shadow:
        0 0 0 4px var(--theme-soft),
        0 16px 34px rgba(95,61,40,0.08);
}

/* Password field with show button */
.login-input-shell input[type="password"],
.login-input-shell input[type="text"]#password {
    padding-right: 72px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 10px;
    z-index: 3;
    transform: translateY(-50%);
    width: auto;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--theme-soft-strong);
    background: rgba(255,255,255,0.76);
    color: var(--brown-dark);
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.25s ease;
}

.toggle-password:hover {
    background: rgba(255,255,255,0.96);
}

/* =========================
   BUTTON
========================= */

.login-btn {
    width: 100%;
    min-height: 54px;
    margin-top: 8px;
    padding: 15px 22px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 18px 38px var(--theme-soft-strong);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        opacity 0.3s ease;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn em {
    font-style: normal;
    transition: transform 0.25s ease;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 48px var(--theme-soft-strong);
}

.login-btn:hover em {
    transform: translateX(4px);
}

.toggle-password:focus-visible,
.login-btn:focus-visible {
    outline: 3px solid var(--theme-soft-strong);
    outline-offset: 3px;
}

/* =========================
   ANIMATIONS
========================= */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loginOrbFloat {
    from {
        transform: translate3d(-12px, -8px, 0) scale(1);
    }

    to {
        transform: translate3d(14px, 10px, 0) scale(1.08);
    }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 520px) {
    .login-page {
        padding: 28px 14px;
    }

    .login-wrapper {
        width: 100%;
    }

    .login-card {
        padding: 38px 22px 28px;
        border-radius: 26px;
    }

    .login-brand-icon {
        width: 54px;
        height: 54px;
        border-radius: 18px;
        margin-bottom: 18px;
    }

    .login-title {
        font-size: 25px;
    }

    .login-subtitle {
        font-size: 12px;
    }

    .login-input-shell input {
        min-height: 52px;
        border-radius: 16px;
    }

    .login-btn {
        min-height: 52px;
    }
}

@media (max-width: 380px) {
    .login-title {
        font-size: 23px;
    }

    .toggle-password {
        right: 8px;
        padding: 7px 10px;
    }

    .login-input-shell input[type="password"],
    .login-input-shell input[type="text"]#password {
        padding-right: 66px;
    }
}
