/* =========================
   ADMIN LOGIN PAGE
   ========================= */

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #101d3c;
    --muted: #66728e;
    --border: #e1e8f4;

    --primary: #1769e0;
    --primary-dark: #0f4fae;
    --primary-soft: #e7f0ff;
    --ink-blue: #1769e0;

    --danger: #c93b3b;
    --success: #12805c;

    --shadow: 0 20px 50px rgba(22, 55, 115, 0.12);

    --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --font-body: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --trans: 0.25s ease;
}

:root[data-theme="dark"] {
    --bg: #0b1228;
    --surface: #121e3b;
    --text: #f2f5ff;
    --muted: #a2afce;
    --border: #26385f;

    --primary-soft: #172d57;
    --ink-blue: #83b4ff;

    --danger: #ff8b8b;
    --success: #5fe0c5;

    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

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

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 18%, rgba(23, 105, 224, 0.12), transparent 26rem),
        radial-gradient(circle at 88% 82%, rgba(242, 182, 48, 0.1), transparent 24rem),
        var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    transition: background-color var(--trans), color var(--trans);
}

button,
input {
    font: inherit;
}

:focus-visible {
    outline: 3px solid #f2b630;
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}


/* =========================
   THEME BUTTON
   ========================= */

.theme-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background-color var(--trans), transform 0.15s ease;
}

.theme-btn:hover {
    background: var(--primary-soft);
}

.theme-btn:active {
    transform: scale(0.94);
}

.theme-btn svg {
    width: 19px;
    height: 19px;
}

.theme-btn .icon-sun {
    display: none;
}

:root[data-theme="dark"] .theme-btn .icon-sun {
    display: block;
}

:root[data-theme="dark"] .theme-btn .icon-moon {
    display: none;
}


/* =========================
   LOGIN PAGE
   ========================= */

.admin-login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.admin-login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
    transition: background-color var(--trans), border-color var(--trans);
}

.admin-logo {
    margin-bottom: 16px;
}

.admin-logo img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--ink-blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.admin-badge svg {
    width: 14px;
    height: 14px;
}

.admin-login-card h1 {
    margin: 14px 0 8px;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}

.login-subtitle {
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 15px;
}


/* =========================
   ALREADY SIGNED IN
   ========================= */

.session-notice {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--primary-soft);
    font-size: 14px;
    font-weight: 600;
}

.session-notice div {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.session-notice a,
.session-notice button {
    border: none;
    background: none;
    color: var(--ink-blue);
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}


/* =========================
   FORM
   ========================= */

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
}

.field-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 50px;
    padding: 0 46px 0 45px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color var(--trans), box-shadow var(--trans), background-color var(--trans);
}

.input-wrapper input::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.18);
}


/* Show / hide password */

.toggle-password {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    transform: translateY(-50%);
    cursor: pointer;
}

.toggle-password:hover {
    color: var(--text);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.toggle-password .icon-hide,
.toggle-password.is-visible .icon-show {
    display: none;
}

.toggle-password.is-visible .icon-hide {
    display: block;
}


/* =========================
   LOGIN BUTTON
   ========================= */

.admin-login-button {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--trans), transform 0.15s ease;
}

.admin-login-button:hover {
    background: var(--primary-dark);
}

.admin-login-button:active {
    transform: scale(0.99);
}

.admin-login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.admin-login-button svg {
    width: 18px;
    height: 18px;
}


/* =========================
   LOGIN MESSAGE
   ========================= */

.login-message {
    min-height: 20px;
    margin-top: 15px;
    color: var(--muted);
    font-size: 14px;
}

.login-message.error {
    color: var(--danger);
    font-weight: 600;
}

.login-message.success {
    color: var(--success);
    font-weight: 600;
}


/* =========================
   BACK HOME
   ========================= */

.back-home {
    display: inline-block;
    margin-top: 22px;
    color: var(--ink-blue);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.back-home:hover {
    text-decoration: underline;
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 500px) {

    .admin-login-card {
        padding: 30px 22px;
        border-radius: 20px;
    }

    .admin-login-card h1 {
        font-size: 27px;
    }

    .theme-btn {
        top: 12px;
        right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {

    * {
        transition: none !important;
    }
}