/* ============================================================
   SPK Bibit Porang AHP — Auth / Login Page
   ============================================================ */

:root {
    --auth-navy: #071f3a;
    --auth-dark-green: #0f5132;
    --auth-green: #198754;
    --auth-emerald: #087f5b;
    --auth-accent: #ffc107;
    --auth-bg: #f6fbf7;
    --auth-bg-tint: #eaf5ec;
    --auth-white: #ffffff;
    --auth-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-shadow: 0 20px 50px rgba(7, 31, 58, 0.1);
    --auth-radius: 22px;
    --auth-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Page wrapper ---- */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: linear-gradient(145deg, var(--auth-bg) 0%, var(--auth-bg-tint) 45%, #e4f3e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Decorative background */
.auth-bg-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
}
.auth-blob-1 {
    width: 420px;
    height: 420px;
    background: rgba(25, 135, 84, 0.18);
    top: -120px;
    right: -80px;
    animation: authFloat 9s ease-in-out infinite;
}
.auth-blob-2 {
    width: 360px;
    height: 360px;
    background: rgba(8, 127, 91, 0.14);
    bottom: -100px;
    left: -60px;
    animation: authFloat 11s ease-in-out infinite reverse;
}
.auth-blob-3 {
    width: 200px;
    height: 200px;
    background: rgba(255, 193, 7, 0.12);
    top: 40%;
    left: 15%;
    animation: authFloat 13s ease-in-out infinite;
}
.auth-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(25, 135, 84, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(25, 135, 84, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 10%, transparent 70%);
}

@keyframes authFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(12px, -18px) scale(1.04); }
}

/* ---- Layout ---- */
.auth-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 980px;
    animation: authCardIn 0.65s ease forwards;
}
@keyframes authCardIn {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr;
    background: var(--auth-white);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow), 0 0 0 1px rgba(7, 31, 58, 0.04);
    overflow: hidden;
}

@media (min-width: 992px) {
    .auth-container {
        grid-template-columns: 1fr 1.05fr;
        min-height: 520px;
    }
}

/* ---- Brand panel (desktop) ---- */
.auth-brand-panel {
    position: relative;
    background: linear-gradient(155deg, var(--auth-navy) 0%, #0a2d4f 50%, var(--auth-dark-green) 100%);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    overflow: hidden;
}
.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 30% 70%, rgba(25, 135, 84, 0.25) 0%, transparent 60%);
    pointer-events: none;
}
.auth-brand-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../img/about-porang.png') center/cover no-repeat;
    opacity: 0.22;
    mix-blend-mode: luminosity;
}
.auth-brand-content {
    position: relative;
    z-index: 2;
}
.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    backdrop-filter: blur(6px);
}
.auth-brand-badge i { color: var(--auth-accent); }
.auth-brand-panel h2 {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}
.auth-brand-panel p {
    font-size: 0.9rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 1.5rem;
}
.auth-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 0.55rem;
}
.auth-feature-list li i {
    color: var(--auth-accent);
    font-size: 0.9rem;
}
.auth-brand-footer {
    position: relative;
    z-index: 2;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin-top: 1rem;
}

/* ---- Login card side ---- */
.auth-card-side {
    padding: 2rem 1.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 576px) {
    .auth-card-side { padding: 2.25rem 2.5rem 2rem; }
}

.auth-mobile-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}
@media (min-width: 992px) {
    .auth-mobile-brand { display: none; }
}

.auth-logo-ring {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--auth-green), var(--auth-emerald));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(25, 135, 84, 0.3);
    position: relative;
}
.auth-logo-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.2), rgba(255, 193, 7, 0.15));
    z-index: -1;
}

.auth-card-side h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--auth-navy);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}
.auth-card-side .auth-subtitle {
    font-size: 0.85rem;
    color: var(--auth-muted);
    line-height: 1.5;
    margin-bottom: 0.35rem;
}
.auth-helper {
    font-size: 0.78rem;
    color: var(--auth-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* ---- Alert ---- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.84rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    animation: authShake 0.4s ease;
}
.auth-alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}
.auth-alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.auth-alert i { font-size: 1rem; margin-top: 0.1rem; flex-shrink: 0; }

/* Notice ringan (bukan peringatan keras) */
.auth-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    font-size: 0.8rem;
    line-height: 1.45;
    margin-bottom: 1.15rem;
    border: 1px solid transparent;
}
.auth-notice-info {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0c4a6e;
}
.auth-notice i {
    font-size: 1rem;
    margin-top: 0.05rem;
    flex-shrink: 0;
    color: #0284c7;
}

.auth-user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    margin-bottom: 1rem;
}
.auth-user-chip-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-green), var(--auth-emerald));
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.auth-user-chip-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.auth-user-chip-text strong {
    font-size: 0.88rem;
    color: var(--auth-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auth-user-chip-text span {
    font-size: 0.75rem;
    color: var(--auth-muted);
}

.auth-error-list {
    margin: -0.5rem 0 1rem;
    padding-left: 1.15rem;
    font-size: 0.78rem;
    color: #b91c1c;
}

@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* ---- Form fields ---- */
.auth-field {
    margin-bottom: 1.15rem;
}
.auth-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--auth-navy);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}
.auth-input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-input-icon {
    position: absolute;
    left: 0.9rem;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    transition: color var(--auth-transition);
    z-index: 2;
}
.auth-input {
    width: 100%;
    height: 46px;
    padding: 0 2.65rem;
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.25;
    font-family: inherit;
    color: var(--auth-navy);
    background: #fafcfb;
    transition: border-color var(--auth-transition), box-shadow var(--auth-transition), background var(--auth-transition);
}
.auth-input::placeholder {
    color: #7c8fa3;
    font-weight: 400;
    opacity: 1;
}
.auth-input-group:hover .auth-input {
    border-color: #cbd5e1;
    background: var(--auth-white);
}
.auth-input:focus {
    outline: none;
    background: var(--auth-white);
}
.auth-input:placeholder-shown:focus {
    border-color: var(--auth-border);
    box-shadow: none;
    background: #fafcfb;
}
.auth-input:not(:placeholder-shown):focus,
.auth-input:focus-visible:not(:placeholder-shown) {
    border-color: var(--auth-green);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.1);
}
.auth-input-group:focus-within .auth-input-icon {
    color: var(--auth-green);
}
.auth-input-group:focus-within:has(.auth-input:placeholder-shown) .auth-input-icon {
    color: #94a3b8;
}
.auth-input-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.65rem;
    background: none;
    border: none;
    color: #94a3b8;
    padding: 0;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: color var(--auth-transition);
    z-index: 2;
}
.auth-input-toggle:hover { color: var(--auth-green); }

/* ---- Submit button ---- */
.auth-btn-submit {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--auth-green) 0%, var(--auth-emerald) 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(8, 127, 91, 0.32);
    transition: transform var(--auth-transition), box-shadow var(--auth-transition), opacity var(--auth-transition);
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
}
.auth-btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(8, 127, 91, 0.38);
}
.auth-btn-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(8, 127, 91, 0.3);
}
.auth-btn-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}
.auth-btn-submit .spinner-border {
    width: 1.1rem;
    height: 1.1rem;
    border-width: 2px;
}

/* ---- Footer links ---- */
.auth-note {
    text-align: center;
    font-size: 0.76rem;
    color: var(--auth-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}
.auth-back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--auth-muted);
    text-decoration: none;
    transition: color var(--auth-transition);
    padding: 0.5rem;
    border-radius: 8px;
}
.auth-back-link:hover {
    color: var(--auth-green);
    background: rgba(25, 135, 84, 0.06);
}

.auth-page-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.72rem;
    color: var(--auth-muted);
    line-height: 1.5;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .auth-container { max-width: 440px; margin: 0 auto; }
}

@media (max-width: 575px) {
    .auth-page { padding: 1rem 0.75rem; align-items: flex-start; padding-top: 1.5rem; }
    .auth-card-side { padding: 1.75rem 1.35rem 1.5rem; }
    .auth-card-side h1 { font-size: 1.2rem; }
    .auth-input { height: 44px; font-size: 0.88rem; padding-left: 2.5rem; padding-right: 2.5rem; }
    .auth-btn-submit { height: 48px; }
}

@media (max-height: 700px) {
    .auth-page { align-items: flex-start; padding-top: 1rem; }
    .auth-logo-ring { width: 52px; height: 52px; font-size: 1.4rem; margin-bottom: 0.75rem; }
    .auth-mobile-brand { margin-bottom: 1rem; }
    .auth-helper { margin-bottom: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-blob { animation: none; }
    .auth-wrapper { animation: none; }
    .auth-alert { animation: none; }
}
