:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --accent: #f59e0b;
    --dark: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    min-height: 100%;
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.5;
    background-color: #f8fafc;
}

button,
input {
    font: inherit;
}

a:focus-visible,
button:focus-visible,
.remember-me input:focus-visible ~ .checkmark {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
}

/* Split Layout Container */
.split-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    position: relative;
    background: #f8fafc;
}

/* -------------------------------------
   LEFT PANEL (Form)
-------------------------------------- */
.split-left {
    flex: 0 0 clamp(420px, 42vw, 550px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
    background-color: #ffffff;
    box-shadow: 20px 0 40px rgba(0,0,0,0.03);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
}

.login-card {
    width: 100%;
}

/* Brand Header */
.brand-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.brand-logo-box {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #60a5fa);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
    letter-spacing: -0.5px;
    overflow-wrap: anywhere;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Greeting */
.greeting-area {
    margin-bottom: 1.75rem;
}

.greeting-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--text-main);
    font-size: 2.2rem;
    line-height: 1.15;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.greeting-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
.text-accent {
    color: var(--accent);
}

/* Form Controls */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-floating-custom {
    position: relative;
    width: 100%;
}

.form-floating-custom label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    margin-left: 2px;
}

.input-group-custom {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 14px;
    transition: all 0.3s ease;
}

.input-group-custom i.main-icon {
    position: absolute;
    left: 1.25rem;
    font-size: 1.2rem;
    color: #94a3b8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.form-input-premium {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 1.1rem 1rem 1.1rem 3.2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    outline: none;
    scroll-margin-block: 1.5rem;
}

#password {
    padding-right: 3.5rem;
}

.form-input-premium::placeholder {
    color: #64748b;
    font-weight: 500;
}

/* Animated Border effect */
.input-border {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group-custom:focus-within .input-border {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-group-custom:focus-within i.main-icon {
    color: var(--primary);
    transform: scale(1.1);
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s ease;
}

.password-toggle:hover, .password-toggle.active {
    color: var(--primary);
}

/* Utilities */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

/* Custom Checkbox */
.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    min-height: 44px;
}

.remember-me input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 20px;
    width: 20px;
}

.checkmark {
    position: relative;
    flex-shrink: 0;
    height: 20px;
    width: 20px;
    background-color: #f1f5f9;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remember-me:hover input ~ .checkmark {
    border-color: #94a3b8;
}

.remember-me input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.remember-me input:checked ~ .checkmark:after {
    display: block;
}

.label-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.forgot-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}
.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Button */
.btn-submit {
    width: 100%;
    min-height: 52px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 1.15rem;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-submit::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: all 0.7s ease;
}

.btn-submit:hover::after {
    left: 150%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(37, 99, 235, 0.3);
}

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

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0 1rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1.5px solid #e2e8f0;
}

.auth-divider span {
    padding: 0 0.85rem;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.3px;
}

/* Google Sign-in Button */
.btn-google {
    width: 100%;
    background: #ffffff;
    color: #1e293b;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.9rem 1.25rem;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.btn-google:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.btn-google:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.btn-google .google-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-google:hover .google-icon {
    transform: scale(1.08);
}

.owner-login {
    text-align: center;
    margin-top: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.owner-login a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    margin-left: 4px;
    transition: color 0.3s ease;
}
.owner-login a:hover {
    text-decoration: underline;
}

/* Layanan Publik */
.layanan-publik-container {
    margin-top: 2rem;
    width: 100%;
}

.layanan-title {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    position: relative;
}

.layanan-title::before, .layanan-title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #e2e8f0;
}
.layanan-title::before { left: 0; }
.layanan-title::after { right: 0; }

.key-modules {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.module-btn {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 1rem 0.5rem;
    text-align: center;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.module-btn:hover {
    background: var(--primary-light);
    transform: translateY(-5px);
    border-color: #bfdbfe;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.1);
}

.module-icon {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.module-btn:hover .module-icon {
    transform: scale(1.15) translateY(-2px);
}

.module-btn span {
    font-size: 0.7rem;
    line-height: 1.4;
    font-weight: 700;
    color: var(--text-main);
}

/* -------------------------------------
   RIGHT PANEL (Image & Glassmorphism)
-------------------------------------- */
.split-right {
    flex: 1;
    min-width: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background-color: #e2e8f0;
}

.split-right-image {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 10s linear;
}

.split-right:hover .split-right-image {
    transform: scale(1.05);
}

/* Subtle overlay so the image is bright but text is readable */
.split-right-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.4) 100%);
    z-index: 1;
}

.split-right-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    height: 100%;
    padding: 3rem;
}

/* Glassmorphism Card */
.glass-quote {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 500px;
    color: white;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.glass-quote::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.3), rgba(255,255,255,0));
}

.quote-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
    display: block;
    opacity: 0.9;
}

.right-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.25;
    letter-spacing: -0.5px;
    color: #f8fafc;
}

.right-subtitle {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Alerts */
.alert-custom {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.alert-custom i {
    flex-shrink: 0;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .split-layout {
        flex-direction: column;
        background: #ffffff;
    }

    .split-left {
        flex: none;
        width: 100%;
        min-height: 100vh;
        min-height: 100svh;
        justify-content: flex-start;
        padding: max(1.5rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
        box-shadow: none;
    }

    .split-right {
        display: none;
    }

    .brand-header {
        gap: 0.75rem;
        margin-bottom: 1.75rem;
    }

    .brand-logo-box {
        width: 44px;
        height: 44px;
    }

    .brand-title {
        font-size: 1.65rem;
    }

    .brand-subtitle {
        font-size: 0.65rem;
        letter-spacing: 0.6px;
    }

    .greeting-title {
        font-size: clamp(1.65rem, 7vw, 2rem);
    }

    .greeting-subtitle {
        align-items: flex-start;
        font-size: 0.875rem;
    }

    .greeting-subtitle i {
        flex-shrink: 0;
    }

    .login-form {
        gap: 1rem;
    }

    .form-input-premium {
        padding-block: 0.875rem;
    }

    .btn-submit {
        padding: 0.875rem 1rem;
    }

    .module-btn {
        padding: 0.75rem 0.25rem;
    }
}

@media (max-width: 359px) {
    .key-modules {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
    }
}
