:root {
    --primary-navy: #0f2942;
    --primary-teal: #0d9488;
    --accent-cyan: #06b6d4;
    --bg-canvas: #f4f7fc;
    --card-bg: #eef3fb;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --focus-ring: rgba(13, 148, 136, 0.25);
}

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

html, body {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

/* Ambient Background Blobs */
.ambient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.45;
    animation: pulseGlow 8s infinite alternate ease-in-out;
    pointer-events: none;
}

.blob-1 {
    width: 350px;
    height: 350px;
    background: rgba(13, 148, 136, 0.15);
    top: -80px;
    left: 10%;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: rgba(6, 182, 212, 0.12);
    bottom: -50px;
    right: 10%;
    animation-delay: -4s;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); opacity: 0.4; }
    100% { transform: scale(1.15) translate(20px, 30px); opacity: 0.6; }
}

/* Top Hero Header Section - Compact Height */
.hero-header {
    width: 100%;
    position: relative;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1;
    flex-shrink: 0;
}

.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.96) contrast(1.02);
    animation: heroZoom 12s ease-out forwards;
}

@keyframes heroZoom {
    0% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Gradient Mask Fade Overlay */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(244, 247, 252, 0.1) 0%,
        rgba(244, 247, 252, 0.5) 50%,
        rgba(244, 247, 252, 0.95) 85%,
        #f4f7fc 100%
    );
}

/* OneKes Branding Badge */
.brand-top-bar {
    position: relative;
    z-index: 5;
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 12px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(15, 41, 66, 0.08);
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.brand-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.brand-divider {
    width: 1px;
    height: 18px;
    background-color: #cbd5e1;
}

.brand-text-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--primary-navy);
    letter-spacing: -0.3px;
    line-height: 1;
}

.brand-text-tag {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--primary-teal);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Content Wrapper - Compact & Centered */
.main-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    padding: 0 1rem;
    margin-top: -85px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: flex-start;
}

/* Welcome Title & Subtitle */
.welcome-header {
    text-align: center;
    margin-bottom: 0.85rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.welcome-title {
    font-weight: 800;
    font-size: 1.65rem;
    color: var(--primary-navy);
    letter-spacing: -0.5px;
    margin-bottom: 0.2rem;
}

.welcome-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.4;
    max-width: 360px;
    margin: 0 auto;
}

/* Floating Compact Login Card */
.login-card {
    width: 100%;
    background: rgba(238, 243, 251, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    padding: 1.5rem 1.6rem;
    box-shadow: 
        0 20px 40px -10px rgba(15, 41, 66, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.7) inset;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Form Labels & Field Containers */
.form-group {
    margin-bottom: 0.95rem;
}

.form-label-custom {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin-bottom: 0.35rem;
}

.input-box-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon-left {
    position: absolute;
    left: 14px;
    font-size: 1.05rem;
    color: #94a3b8;
    transition: color 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 3;
}

.form-control-custom {
    width: 100%;
    height: 45px;
    padding: 0.5rem 1rem 0.5rem 2.6rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    background-color: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-control-custom::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.form-control-custom:focus {
    background-color: #ffffff;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px var(--focus-ring), 0 3px 8px rgba(13, 148, 136, 0.08);
}

.form-control-custom:focus ~ .field-icon-left {
    color: var(--primary-teal);
    transform: scale(1.08);
}

/* Password Toggle Eye Button */
.btn-toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.05rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
    z-index: 3;
}

.btn-toggle-password:hover {
    color: var(--primary-navy);
    background-color: #f1f5f9;
}

/* Options Row */
.options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.15rem;
}

.form-check-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.form-check-custom input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-teal);
    border-radius: 4px;
    cursor: pointer;
}

.check-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.forgot-pass-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-teal);
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-pass-link:hover {
    color: var(--primary-navy);
    text-decoration: underline;
}

/* Submit Button */
.btn-submit-main {
    position: relative;
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, #0f2942 0%, #173b5e 50%, #0d9488 100%);
    background-size: 200% 200%;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 0.925rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 6px 16px -3px rgba(15, 41, 66, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.btn-submit-main:hover {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -3px rgba(13, 148, 136, 0.4);
    color: #ffffff;
}

.btn-submit-main:active {
    transform: translateY(0);
}

.btn-submit-main .btn-arrow-icon {
    font-size: 1.05rem;
    transition: transform 0.25s ease;
}

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

/* Button Loading Animation State */
.btn-submit-main.is-loading {
    pointer-events: none;
    opacity: 0.9;
}

.btn-submit-main .spinner-border {
    width: 1.1rem;
    height: 1.1rem;
    border-width: 0.16em;
    display: none;
}

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

.btn-submit-main.is-loading .btn-text-content,
.btn-submit-main.is-loading .btn-arrow-icon {
    display: none;
}

/* Divider & Secondary Actions */
.divider-wrapper {
    display: flex;
    align-items: center;
    margin: 1rem 0 0.75rem 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: #cbd5e1;
}

.divider-text {
    padding: 0 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* Quick Action Support Button */
.btn-admin-support {
    width: 100%;
    height: 40px;
    background-color: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    color: var(--primary-navy);
    font-size: 0.825rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-admin-support:hover {
    border-color: var(--primary-teal);
    background-color: #f8fafc;
    color: var(--primary-teal);
}

/* Alert Styling - Clean Positioned Close Button */
.custom-alert {
    position: relative;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shakeAlert 0.4s ease;
    overflow: hidden;
}

.custom-alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.custom-alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.custom-alert .btn-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px;
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: none;
    outline: none;
    cursor: pointer;
    background-color: transparent;
}

.custom-alert .btn-close:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
}

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

/* Footer Copyright */
.footer-copyright {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    line-height: 1.4;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.footer-copyright strong {
    color: var(--primary-navy);
    font-weight: 700;
}

/* Entry Keyframe Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive Adjustments for Mobile Viewports */
@media (max-width: 575.98px) {
    html, body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .hero-header {
        height: 170px;
    }

    .brand-top-bar {
        margin-top: 10px;
        padding: 4px 14px 4px 10px;
    }

    .brand-logo-img {
        height: 28px;
    }

    .brand-text-name {
        font-size: 0.95rem;
    }

    .main-container {
        margin-top: -65px;
        padding-bottom: 1.5rem;
    }

    .welcome-title {
        font-size: 1.45rem;
    }

    .welcome-subtitle {
        font-size: 0.8rem;
    }

    .login-card {
        padding: 1.25rem 1.15rem;
        border-radius: 20px;
    }
}
