/**
 * Optik Mata Alfian - Modern Login Stylesheet
 * Refined, responsive, and accessible authentication layout.
 */

:root {
    --login-primary: #00a651;
    --login-primary-hover: #008c44;
    --login-primary-dark: #006b34;
    --login-primary-soft: rgba(0, 166, 81, 0.08);
    --login-primary-glow: rgba(0, 166, 81, 0.22);
    --login-accent: #f59e0b;
    --login-accent-soft: rgba(245, 158, 11, 0.15);
    --login-dark: #0f172a;
    --login-dark-card: #14221a;
    --login-text: #1e293b;
    --login-muted: #64748b;
    --login-border: #e2e8f0;
    --login-border-focus: #00a651;
    --login-bg: #f4f7f5;
    --login-card-bg: #ffffff;
    --login-error-bg: #fef2f2;
    --login-error-border: #fecaca;
    --login-error-text: #dc2626;
    --login-shadow-card: 0 25px 60px -15px rgba(15, 23, 42, 0.12), 0 0 1px 1px rgba(0, 0, 0, 0.04);
    --login-shadow-button: 0 8px 20px -4px rgba(0, 166, 81, 0.35);
    --login-shadow-button-hover: 0 12px 24px -4px rgba(0, 166, 81, 0.45);
    --font-inter: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html,
body,
.main-wrapper {
    min-height: 100%;
}

body {
    color: var(--login-text);
    background-color: var(--login-bg);
    font-family: var(--font-inter);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* ============================================================== */
/* Main Container & Background Aesthetics */
/* ============================================================== */
.login-shell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(ellipse 70% 50% at 20% 20%, rgba(0, 166, 81, 0.08), transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(245, 158, 11, 0.06), transparent 70%),
        linear-gradient(135deg, #f8faf9 0%, #edf4f0 100%);
    overflow: hidden;
}

/* Subtle Geometric Grid & Lens Watermark */
.login-shell::before {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 166, 81, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 166, 81, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    content: "";
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
}

/* Floating Ambient Orbs */
.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
    animation: orbFloat 18s ease-in-out infinite alternate;
}

.login-orb--one {
    top: -100px;
    left: 10%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(0, 166, 81, 0.25) 0%, transparent 70%);
}

.login-orb--two {
    bottom: -120px;
    right: 8%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, transparent 70%);
    animation-delay: -9s;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, 40px) scale(1.08);
    }
    100% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* ============================================================== */
/* Login Card Container */
/* ============================================================== */
.login-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    width: 100%;
    max-width: 1060px;
    min-height: 640px;
    background: var(--login-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    box-shadow: var(--login-shadow-card);
    overflow: hidden;
    backdrop-filter: blur(16px);
    animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================== */
/* Left Showcase (Hero / Optical Brand Identity) */
/* ============================================================== */
.login-showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    color: #ffffff;
    background:
        radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.12), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(245, 158, 11, 0.18), transparent 50%),
        linear-gradient(140deg, #00a651 0%, #007a3d 45%, #0d3820 100%);
    overflow: hidden;
}

/* Optical Lens Rings Watermark */
.login-showcase::before {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -80px;
    width: 380px;
    height: 380px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    pointer-events: none;
}

.login-showcase::after {
    content: "";
    position: absolute;
    right: -130px;
    bottom: -130px;
    width: 480px;
    height: 480px;
    border: 55px solid rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    pointer-events: none;
}

.login-showcase__header {
    position: relative;
    z-index: 2;
}

.login-brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.login-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #ffffff;
    color: var(--login-primary);
    border-radius: 50%;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-brand-name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #ffffff;
}

.login-showcase__content {
    position: relative;
    z-index: 2;
    margin: 36px 0;
}

.login-kicker-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    padding: 4px 12px;
    background: rgba(245, 158, 11, 0.22);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 6px;
    color: #ffe89e;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.login-showcase h1 {
    margin-bottom: 14px;
    font-size: clamp(28px, 3.2vw, 38px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-showcase__subtitle {
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.85);
    max-width: 480px;
}

/* Feature Cards Grid */
.login-feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.login-feature-item:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(4px);
}

.login-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    color: #ffffff;
    font-size: 16px;
}

.login-feature-text strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.login-feature-text span {
    display: block;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.4;
}

/* Showcase Footer Status */
.login-showcase__footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
}

.login-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
}

.pulse-dot::after {
    content: "";
    position: absolute;
    inset: -3px;
    background-color: rgba(74, 222, 128, 0.45);
    border-radius: 50%;
    animation: pulseRing 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    70% {
        transform: scale(2.2);
        opacity: 0;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.login-showcase-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================================== */
/* Right Form Panel */
/* ============================================================== */
.login-form-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
    background: #ffffff;
}

.login-form-inner {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

/* Logo & Branding */
.login-form-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.login-form-logo {
    display: block;
    max-height: 56px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.04));
}

.login-form-heading {
    margin-bottom: 24px;
}

.login-welcome-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 3px 10px;
    background: var(--login-primary-soft);
    color: var(--login-primary-dark);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-form-heading h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--login-text);
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.login-form-heading p {
    font-size: 13px;
    color: var(--login-muted);
    line-height: 1.5;
}

/* Error Banner Card */
.login-alert-danger {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 20px;
    background-color: var(--login-error-bg);
    border: 1px solid var(--login-error-border);
    border-radius: 12px;
    color: var(--login-error-text);
    font-size: 12.5px;
    line-height: 1.45;
    animation: shakeAlert 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

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

@keyframes shakeAlert {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* Form Groups & Inputs */
.login-form-group {
    margin-bottom: 20px;
}

.login-form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid var(--login-border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.login-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.login-form-control {
    flex: 1;
    height: 48px;
    padding: 0 14px 0 0;
    border: none;
    background: transparent;
    color: var(--login-text);
    font-size: 13.5px;
    font-weight: 500;
    outline: none;
}

.login-form-control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Focus & Error States */
.login-input-wrapper:focus-within {
    background: #ffffff;
    border-color: var(--login-border-focus);
    box-shadow: 0 0 0 4px var(--login-primary-glow);
}

.login-input-wrapper:focus-within .login-input-icon {
    color: var(--login-primary);
}

.login-form-group.has-error .login-input-wrapper {
    background: #fffafa;
    border-color: #f87171;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.login-form-group.has-error .login-input-icon {
    color: #ef4444;
}

.login-error-text {
    display: block;
    margin-top: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--login-error-text);
}

/* Password Toggle Button */
.login-password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-right: 3px;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.login-password-toggle:hover {
    color: var(--login-primary-dark);
    background-color: rgba(0, 166, 81, 0.08);
}

.login-password-toggle:focus-visible {
    outline: 2px solid var(--login-primary);
    outline-offset: -2px;
}

/* Options Row (Remember Me & Help) */
.login-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 12.5px;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--login-muted);
}

.login-remember input[type="checkbox"] {
    position: relative;
    appearance: none;
    width: 17px;
    height: 17px;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0;
}

.login-remember input[type="checkbox"]:checked {
    background-color: var(--login-primary);
    border-color: var(--login-primary);
}

.login-remember input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.login-remember input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 3px var(--login-primary-glow);
}

.login-remember:hover span {
    color: var(--login-text);
}

/* Submit Button */
.login-submit-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    padding: 0 24px;
    background: linear-gradient(135deg, #00b85a 0%, #008f45 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: var(--login-shadow-button);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.login-submit-btn:hover {
    background: linear-gradient(135deg, #00c762 0%, #009d4c 100%);
    box-shadow: var(--login-shadow-button-hover);
    transform: translateY(-1.5px);
}

.login-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 166, 81, 0.25);
}

.login-submit-btn:focus-visible {
    outline: 3px solid var(--login-accent);
    outline-offset: 2px;
}

.login-submit-icon {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.login-submit-btn:hover .login-submit-icon {
    transform: translateX(4px);
}

/* Button Loading State */
.login-submit-btn.is-loading {
    pointer-events: none;
    opacity: 0.88;
}

.login-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.login-submit-btn.is-loading .login-spinner {
    display: inline-block;
}

.login-submit-btn.is-loading .login-submit-icon {
    display: none;
}

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

/* Form Helper & Security Footer */
.login-form-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--login-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-help-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--login-muted);
}

.login-help-note i {
    color: var(--login-primary);
    font-size: 14px;
}

.login-security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: #94a3b8;
}

.login-security-badge i {
    color: #10b981;
}

/* ============================================================== */
/* Responsive Design */
/* ============================================================== */

/* Tablet (max 991px) */
@media (max-width: 991.98px) {
    .login-shell {
        padding: 20px 16px;
    }

    .login-card {
        grid-template-columns: 1fr;
        max-width: 520px;
        min-height: auto;
        border-radius: 22px;
    }

    .login-showcase {
        padding: 32px 28px;
        min-height: auto;
    }

    .login-showcase__content {
        margin: 20px 0;
    }

    .login-showcase h1 {
        font-size: 24px;
    }

    .login-showcase__subtitle {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .login-feature-list {
        display: none;
    }

    .login-showcase__footer {
        padding-top: 14px;
    }

    .login-form-panel {
        padding: 36px 28px;
    }

    .login-form-brand {
        display: none;
    }
}

/* Mobile Devices (max 575px) */
@media (max-width: 575.98px) {
    .login-shell {
        padding: 12px;
        align-items: flex-start;
    }

    .login-card {
        border-radius: 18px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }

    .login-showcase {
        padding: 24px 20px;
    }

    .login-showcase h1 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .login-showcase__subtitle {
        display: none;
    }

    .login-showcase__footer {
        display: none;
    }

    .login-form-panel {
        padding: 28px 20px;
    }

    .login-form-heading h2 {
        font-size: 20px;
    }

    .login-form-control {
        height: 46px;
        font-size: 13px;
    }

    .login-submit-btn {
        height: 46px;
        font-size: 13.5px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .login-card,
    .login-orb,
    .pulse-dot::after,
    .login-submit-btn,
    .login-feature-item {
        animation: none !important;
        transition: none !important;
    }
}
