/**
 * Login Page — SPK Prioritas Pengadaan Buku
 */

:root {
    --login-emerald-dark: #063B2B;
    --login-emerald: #0F5132;
    --login-emerald-light: #198754;
    --login-gold: #C9A227;
    --login-text: #111827;
    --login-muted: #6B7280;
    --login-border: #DDE5DF;
    --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-hero-title: "Playfair Display", "Merriweather", Georgia, serif;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

.login-page {
    min-height: 100vh;
    font-family: var(--font-body);
    background: var(--login-emerald-dark);
    color: #fff;
    overflow-x: hidden;
}

/* Background layers */
.login-background {
    position: fixed;
    inset: 0;
    background-image: url('../img/login/login-bg.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transform: scale(1.04);
    filter: saturate(1.18) contrast(1.1) brightness(1.06);
    z-index: 0;
}

.login-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 14% 22%, rgba(201, 162, 39, 0.24), transparent 30%),
        radial-gradient(circle at 78% 68%, rgba(25, 135, 84, 0.12), transparent 42%),
        linear-gradient(
            108deg,
            rgba(6, 59, 43, 0.38) 0%,
            rgba(15, 81, 50, 0.22) 38%,
            rgba(3, 30, 23, 0.52) 68%,
            rgba(3, 30, 23, 0.72) 100%
        );
    z-index: 1;
}

.login-decor {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.18;
}

.login-decor-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    opacity: 0.5;
}

.login-watermark {
    position: fixed;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.07;
    color: #fff;
}

.login-watermark i {
    font-size: clamp(6rem, 14vw, 9rem);
    line-height: 1;
}

.login-watermark span {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: 0.08em;
}

/* Layout */
.login-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    align-items: center;
    gap: 56px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 32px 72px;
    border: 1px solid rgba(201, 162, 39, 0.14);
    border-radius: 28px;
    background: rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(4px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Brand panel */
.login-brand-panel {
    animation: fadeIn 0.55s ease-out both;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-logo-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, #064E3B, #198754);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 12px 28px rgba(15, 81, 50, 0.28);
    border: 1px solid rgba(201, 162, 39, 0.35);
}

.brand-logo-badge {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--login-gold);
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(201, 162, 39, 0.45);
    border-radius: 999px;
    background: rgba(201, 162, 39, 0.12);
}

.login-brand-panel h1,
.login-brand-title {
    font-family: var(--font-hero-title);
    font-size: clamp(1.75rem, 4vw, 2.625rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 16px;
    color: #fff;
    max-width: 620px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.38);
}

.login-brand-panel h1::after {
    content: '';
    display: block;
    width: 72px;
    height: 4px;
    margin-top: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--login-gold), rgba(201, 162, 39, 0.2));
}

.brand-school-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 14px;
    padding: 0.55rem 1rem 0.55rem 0.85rem;
    max-width: fit-content;
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.28) 0%, rgba(201, 162, 39, 0.1) 100%);
    border: 1px solid rgba(201, 162, 39, 0.55);
    border-left: 4px solid var(--login-gold);
    border-radius: 12px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.brand-school-name i {
    font-size: 1.15rem;
    color: var(--login-gold);
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.25));
}

.brand-school-name span {
    line-height: 1.2;
}

.brand-desc {
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
    max-width: 560px;
    margin: 0 0 24px;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.32);
}

.login-brand-panel > p.brand-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.82);
}

.login-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.login-feature-list span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    backdrop-filter: blur(6px);
}

.login-feature-list i {
    color: var(--login-gold);
    font-size: 0.85rem;
}

/* Login card */
.login-card {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 26px;
    padding: 34px;
    box-shadow:
        0 28px 64px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    backdrop-filter: blur(18px);
    animation: fadeUp 0.45s ease-out both;
    animation-delay: 0.08s;
}

.login-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #064E3B 0%, #198754 55%, var(--login-gold) 100%);
}

.login-card-header {
    margin-bottom: 22px;
    padding-top: 4px;
}

.login-card-header-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.login-card-header-text h2 {
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--login-text);
    margin: 0 0 4px;
    line-height: 1.25;
}

.login-card-header-text p {
    font-size: 0.84rem;
    color: var(--login-muted);
    margin: 0;
    line-height: 1.45;
}

.login-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #064E3B, #198754);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 10px 22px rgba(15, 81, 50, 0.22);
    border: 1px solid rgba(201, 162, 39, 0.32);
    margin-bottom: 0;
}

.login-card-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--login-text);
    margin: 0 0 6px;
}

.login-card-header p {
    font-size: 0.88rem;
    color: var(--login-muted);
    margin: 0;
    line-height: 1.5;
}

/* Alert */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    font-size: 0.84rem;
    line-height: 1.45;
}

.login-alert i {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

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

.login-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.login-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}

.login-input-wrap {
    position: relative;
    border-radius: 14px;
    transition: box-shadow 0.15s ease;
}

.login-input-wrap:focus-within {
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
}

.login-input-wrap:focus-within .login-input-icon {
    color: var(--login-emerald-light);
}

.login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.15s ease;
    z-index: 1;
}

.form-control-login {
    width: 100%;
    height: 48px;
    border: 1px solid var(--login-border);
    border-radius: 14px;
    padding: 0 44px;
    font-size: 15px;
    color: var(--login-text);
    background: #FAFCFB;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.form-control-login:-webkit-autofill,
.form-control-login:-webkit-autofill:hover,
.form-control-login:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--login-text);
    -webkit-box-shadow: 0 0 0 1000px #FAFCFB inset;
    box-shadow: 0 0 0 1000px #FAFCFB inset;
    transition: background-color 9999s ease-out 0s;
}

.form-control-login::placeholder {
    color: #9CA3AF;
}

.form-control-login:hover {
    border-color: #C9D5CF;
    background: #fff;
}

.form-control-login:focus {
    border-color: var(--login-emerald-light);
    background: #fff;
    box-shadow: none;
    outline: none;
}

.login-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #9CA3AF;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.15s, background 0.15s;
}

.login-password-toggle:hover {
    color: #6B7280;
    background: #F3F4F6;
}

/* Button */
.btn-login {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #0F5132, #198754);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(15, 81, 50, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
    margin-top: 4px;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(15, 81, 50, 0.30);
}

.btn-login:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.95),
        0 0 0 6px rgba(25, 135, 84, 0.35),
        0 12px 24px rgba(15, 81, 50, 0.22);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

.btn-login-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login.is-loading {
    pointer-events: none;
}

.login-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: -2px;
    margin-right: 6px;
}

/* Help & demo */
.login-help-text {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid #EEF2F0;
    font-size: 0.76rem;
    color: var(--login-muted);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.login-help-text i {
    margin-top: 1px;
    flex-shrink: 0;
    color: var(--login-emerald-light);
}

.login-demo-box {
    margin-top: 16px;
    padding: 14px 14px 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, #F4FAF7 0%, #F8FAFC 100%);
    border: 1px dashed rgba(25, 135, 84, 0.28);
    font-size: 0.76rem;
    color: #4B5563;
}

.login-demo-head {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    color: #065F46;
}

.login-demo-head i {
    font-size: 0.9rem;
}

.login-demo-head strong {
    font-size: 0.76rem;
    font-weight: 700;
}

.login-demo-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-demo-item {
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: center;
    gap: 8px;
}

.login-demo-role {
    font-size: 0.7rem;
    font-weight: 700;
    color: #065F46;
    background: rgba(25, 135, 84, 0.1);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    text-align: center;
}

.login-demo-cred {
    font-size: 0.72rem;
    color: #374151;
}

.login-demo-box code {
    font-size: 0.72rem;
    background: #fff;
    color: #0F5132;
    border: 1px solid #D1FAE5;
    padding: 0.12rem 0.38rem;
    border-radius: 6px;
}

/* Footer */
.login-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 18px 20px;
    margin-top: -36px;
}

.login-footer p {
    margin: 0;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
}

.login-footer p strong {
    color: rgba(201, 162, 39, 0.95);
    font-weight: 700;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive */
@media (max-width: 900px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        max-width: 520px;
        gap: 28px;
        padding: 32px 20px 72px;
        border: none;
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
    }

    .login-watermark {
        display: none;
    }

    .login-brand-panel {
        text-align: center;
    }

    .brand-logo {
        justify-content: center;
    }

    .login-brand-panel h1 {
        margin-left: auto;
        margin-right: auto;
    }

    .login-brand-panel h1::after {
        margin-left: auto;
        margin-right: auto;
    }

    .login-brand-panel > p.brand-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .brand-school-name {
        margin-left: auto;
        margin-right: auto;
    }

    .login-feature-list {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        padding: 24px 18px 72px;
    }

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

    .login-feature-list span:nth-child(3) {
        display: none;
    }

    .login-demo-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .login-demo-role {
        width: fit-content;
    }

    .login-overlay {
        background:
            radial-gradient(circle at 50% 0%, rgba(201, 162, 39, 0.16), transparent 35%),
            linear-gradient(180deg, rgba(6, 59, 43, 0.55) 0%, rgba(3, 30, 23, 0.68) 100%);
    }
}

@media (max-height: 700px) {
    .login-wrapper {
        align-items: flex-start;
        padding-top: 24px;
    }
}
