/* Variables */
:root {
    --primary-gradient: linear-gradient(to right, #F12E77, #B91EC9, #7D19F5);
    --accent-color: #B91EC9;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --input-bg: rgba(255, 255, 255, 0.1);
}

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

body,
body:focus,
body:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    border: none;
    box-shadow: none;
}

body.login-page {
    min-height: 100vh;
    background-color: #0f172a;
    color: var(--text-main);
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.main-container {
    width: 100%;
    max-width: 1050px;
    /* Lebar box utama */
    min-height: auto;
    max-height: 90vh;
    display: flex;
}

.split-card {
    display: flex;
    width: 100%;
    background: var(--glass-bg);
    border-radius: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden; /* Ensures border-radius works on child elements */
}

.branding-side {
    flex: 1.5;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 2.5rem 2.5rem 1.5rem 2.5rem;
    background-image: url('../../../public/Elemen/Logo/Gambar1.webp');
    background-size: cover;
    background-position: calc(50% + 50px) center;
}

.branding-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.7));
    z-index: 1;
}

.brand-logo {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.brand-logo img {
    height: 2.6rem;
    width: auto;
    object-fit: contain;
}

.branding-title {
    position: relative;
    z-index: 10;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}

.theme-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.branding-desc {
    position: relative;
    z-index: 10;
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
    max-width: 270px;
    margin-bottom: 2.5rem;
}

.features-grid {
    position: relative;
    z-index: 10;
    display: flex;
    background: rgba(15, 23, 42, 0.8); /* A more solid background using a matching dark color */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    padding: 1.25rem 0;
    width: 100%;
    margin-top: auto;
}

.feature-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 0.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-card:last-child {
    border-right: none;
}

.feature-icon-circle {
    width: auto;
    height: auto;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--accent-color);
}

.feature-icon-circle svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
}

.feature-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.feature-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 2.5rem 1.5rem 2.5rem;
    position: relative;
    overflow-y: auto;
}

/* Custom Scrollbar to keep it elegant (Glassmorphism style) */
.form-side::-webkit-scrollbar {
    width: 4px;
}

.form-side::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.form-content {
    width: 100%;
    max-width: 340px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1;
}

.hidden {
    display: none !important;
}

.card-header {
    text-align: center;
}

.title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.05em;
}

.subtitle {
    margin-top: 0.25rem;
    font-size: 11px;
    color: var(--text-muted);
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    padding-bottom: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn.active {
    color: var(--text-main);
    border-bottom: 2px solid var(--accent-color); 
}

.tab-btn:hover:not(.active) {
    color: #d1d5db;
}

/* General Form Settings */
#loginForm,
#registerForm {
    display: flex;
    flex-direction: column;
}

/* Specific to Login - More spacious due to fewer inputs */
#loginForm {
    gap: 1.25rem;
}

#loginForm .input-group {
    gap: 1rem;
}

/* Specific to Register - More compact to fit the frame */
#registerForm {
    gap: 0.75rem;
}

#registerForm .input-group {
    gap: 0.5rem;
}

#registerForm .input-field {
    padding: 0.375rem 1rem 0.375rem 2.75rem; /* Slightly slimmer */
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-icon svg {
    height: 1rem;
    width: 1rem;
}

.input-field {
    width: 100%;
    padding: 0.375rem 1rem 0.375rem 2.75rem;
    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.input-field:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color), 0 0 8px rgba(185, 30, 201, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.password-toggle svg {
    height: 1rem;
    width: 1rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.remember-me input[type="checkbox"],
.remember-me label {
    cursor: pointer;
}

.forgot-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.btn-login {
    width: 100%;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 10px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s, opacity 0.2s;
}

.btn-login:hover {
    opacity: 0.9;
}

.btn-login:active {
    transform: scale(0.95);
}

.btn-login:disabled,
.social-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.separator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.2rem 0 1.2rem 0;
}

.separator-line {
    flex-grow: 1;
    height: 1px;
    background-color: var(--glass-border);
}

.separator-text {
    font-size: 12px;
    text-transform: lowercase;
    letter-spacing: 0.05em;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.social-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.social-btn:hover {
    background: var(--glass-border);
}

.social-btn svg {
    height: 1rem;
    width: 1rem;
}

.legal-text {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 1rem;
    margin-bottom: 0;
}

.legal-text a {
    color: var(--accent-color);
    text-decoration: none;
}

.legal-text a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
    .split-card {
        flex-direction: column;
    }

    .branding-side {
        flex: none;
        min-height: 280px;
        padding: 3rem 1.5rem;
        background-position: center;
        align-items: center;
        text-align: center;
    }

    .branding-title {
        font-size: 1.75rem;
    }

    .branding-desc {
        max-width: 100%;
        margin-bottom: 0;
    }

    .features-grid {
        display: none; /* Hidden so the branding header isn't too long on mobile */
    }

    .main-container {
        max-width: 480px;
        max-height: none;
    }

    .form-side {
        overflow: visible;
        padding: 2rem 1.5rem;
    }
}

/* Page Transition Overlay */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
    flex-direction: column;
    gap: 1rem;
}

.page-transition-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

/* Hide form while checking auth or during transition */
.is-transitioning .main-container {
    display: none !important;
}