@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
    --bg-from: #c9d6e3;
    --bg-to: #e8edf2;
    --card-bg: #ffffff;
    --card-border: rgba(0,0,0,0.06);
    --card-shadow: 0 24px 60px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.06);
    --title-color: #0f1117;
    --subtitle-color: #6b7280;
    --label-color: #374151;
    --input-bg: #f0f2f8;
    --input-border: transparent;
    --input-border-focus: #4f46e5;
    --input-color: #111827;
    --input-placeholder: #9ca3af;
    --icon-color: #9ca3af;
    --btn-bg: #4f46e5;
    --btn-hover: #4338ca;
    --btn-color: #ffffff;
    --switch-color: #6b7280;
    --switch-link: #4f46e5;
    --footer-bg: rgba(0,0,0,0.15);
    --footer-color: rgba(255,255,255,0.7);
    --footer-link: rgba(255,255,255,0.9);
    --toggle-bg: rgba(255,255,255,0.25);
    --toggle-color: #374151;
    --toggle-hover: rgba(255,255,255,0.4);
}

[data-theme="dark"] {
    --bg-from: #0f1117;
    --bg-to: #1a1d2e;
    --card-bg: #1e2130;
    --card-border: rgba(255,255,255,0.06);
    --card-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.3);
    --title-color: #f9fafb;
    --subtitle-color: #9ca3af;
    --label-color: #d1d5db;
    --input-bg: rgba(255,255,255,0.07);
    --input-border: rgba(255,255,255,0.08);
    --input-border-focus: #6366f1;
    --input-color: #f3f4f6;
    --input-placeholder: #6b7280;
    --icon-color: #6b7280;
    --btn-bg: #4f46e5;
    --btn-hover: #6366f1;
    --btn-color: #ffffff;
    --switch-color: #9ca3af;
    --switch-link: #818cf8;
    --footer-bg: rgba(0,0,0,0.3);
    --footer-color: rgba(255,255,255,0.45);
    --footer-link: rgba(255,255,255,0.65);
    --toggle-bg: rgba(255,255,255,0.08);
    --toggle-color: #d1d5db;
    --toggle-hover: rgba(255,255,255,0.15);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-from) 0%, var(--bg-to) 100%);
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease;
}

/* ── Background texture ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(99,102,241,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 70%, rgba(139,92,246,0.06) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ── Theme Toggle Button ── */
.theme-toggle-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--toggle-bg);
    color: var(--toggle-color);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: background 0.2s, transform 0.2s;
}

.theme-toggle-btn:hover {
    background: var(--toggle-hover);
    transform: scale(1.1);
}

/* ── Flash Messages ── */
.flash-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    max-width: 400px;
}

.flash-message {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
}

.flash-message.success {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

/* ── Page Wrapper ── */
.page-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 80px;
    position: relative;
    z-index: 1;
}

/* ── Card ── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    padding: 40px 40px 36px;
    width: 100%;
    max-width: 440px;
    backdrop-filter: blur(16px);
    transition: background 0.3s, box-shadow 0.3s;
}

/* ── Logo ── */
.logo-wrap {
    text-align: center;
    margin-bottom: 28px;
}

.logo-img {
    width: 140px;
    height: auto;
    border-radius: 10px;
    display: inline-block;
}

/* ── Titles ── */
.card-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--title-color);
    text-align: center;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--subtitle-color);
    text-align: center;
    margin-bottom: 28px;
    font-weight: 400;
}

/* ── Auth Views ── */
.auth-view { }
.auth-view.hidden { display: none; }

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

/* ── Form Section Title ── */
.form-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--switch-link);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding-top: 8px;
    border-top: 1px solid var(--card-border);
    margin-top: 4px;
}

.form-section-title:first-child {
    padding-top: 0;
    border-top: none;
    margin-top: 0;
}

/* ── Field Group ── */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--label-color);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* ── Input Wrap ── */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--icon-color);
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
}

.input-wrap input {
    width: 100%;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 10px;
    padding: 12px 44px 12px 40px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    color: var(--input-color);
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

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

.input-wrap input:focus {
    border-color: var(--input-border-focus);
    background: var(--input-bg);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

/* ── Toggle Password ── */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    box-shadow: none;
    padding: 4px;
    color: var(--icon-color);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    border-radius: 4px;
}

.toggle-password:hover { color: var(--input-border-focus); }

/* ── Primary Button ── */
.btn-primary {
    width: 100%;
    background: var(--btn-bg);
    color: var(--btn-color);
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    margin-top: 4px;
    box-shadow: 0 4px 14px rgba(79,70,229,0.3);
}

.btn-primary:hover {
    background: var(--btn-hover);
    box-shadow: 0 6px 20px rgba(79,70,229,0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

/* ── Status Page ── */
.status-icon-wrap {
    text-align: center;
    margin-bottom: 16px;
}

.status-icon {
    font-size: 56px;
}

.status-icon.pending { color: #f59e0b; }
.status-icon.denied { color: #ef4444; }
.status-icon.approved { color: #10b981; }

.status-info {
    background: var(--input-bg);
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
    color: var(--label-color);
    font-size: 13px;
    line-height: 1.6;
}

.status-info p { margin: 0 0 8px 0; }
.status-info p:last-child { margin-bottom: 0; }
.status-info a { color: var(--switch-link); text-decoration: none; }
.status-info a:hover { text-decoration: underline; }

/* ── Switch Text ── */
.switch-text {
    text-align: center;
    color: var(--switch-color);
    font-size: 13px;
    margin-top: 20px;
}

.switch-link {
    color: var(--switch-link);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.switch-link:hover { opacity: 0.75; text-decoration: underline; }

/* ── Footer ── */
footer {
    background: var(--footer-bg);
    color: var(--footer-color);
    font-size: 11px;
    text-align: center;
    padding: 10px 16px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(4px);
}

footer p { margin: 0; line-height: 1.6; }

footer a {
    color: var(--footer-link);
    text-decoration: none;
}

footer a:hover { text-decoration: underline; }

/* ── Mobile ── */
@media (max-width: 520px) {
    .card {
        padding: 32px 24px 28px;
        border-radius: 20px;
        max-width: 100%;
    }

    .logo-img { width: 120px; }

    .card-title { font-size: 22px; }

    .input-wrap input { font-size: 16px; }

    .page-wrapper { padding: 50px 16px 70px; }
}

@media (max-width: 360px) {
    .card { padding: 28px 18px 24px; }
    .card-title { font-size: 20px; }
}
