/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow: hidden;
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

/* Container Layout */
.container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Info Section (Welcome) */
.info-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    width: 100%;
    position: relative;
    overflow: hidden;
    max-width: 800px;
}

.info-content {
    text-align: center;
    color: white;
    z-index: 2;
    position: relative;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem; 
}

.logo-icon {
    width: 50px; 
    height: 50px; 
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logo-icon i {
    font-size: 1.8rem; 
    color: white;
}

.brand-name {
    font-size: 2.2rem; 
    font-weight: 700;
}

.welcome-title {
    font-size: 1.8rem; 
    font-weight: 600;
    margin-bottom: 0.75rem; 
}

.welcome-subtitle {
    font-size: 1rem; 
    opacity: 0.9;
    margin-bottom: 2rem; 
    font-weight: 300;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem; 
    margin-top: 1.5rem;
    margin-bottom: 2rem; 
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem; 
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-item i {
    font-size: 1.5rem; 
    margin-bottom: 0.25rem;
}

.feature-item span {
    font-size: 0.9rem; 
    font-weight: 500;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem; 
    margin-bottom: 1rem; 
}

.btn-action {
    background-color: white;
    color: #2563eb;
    border: none;
    padding: 0.75rem 2rem; 
    border-radius: 12px;
    font-size: 0.95rem; 
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-google {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 0.75rem 1.5rem; 
    border-radius: 12px;
    font-size: 0.95rem; 
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    margin-bottom: 1rem; 
}

.btn-google:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-google i {
    font-size: 1.1rem;
}

/* Decoration Circles */
.decoration-circles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    animation: float 8s ease-in-out infinite;
}

.circle-1 { width: 250px; height: 250px; top: 15%; right: 5%; animation-delay: 0s; }
.circle-2 { width: 180px; height: 180px; bottom: 25%; left: 10%; animation-delay: 3s; }
.circle-3 { width: 120px; height: 120px; top: 70%; right: 25%; animation-delay: 6s; }

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-25px); }
}

/* === FORM SECTION === */
.form-section {
    /* PERBAIKAN #1: Pastikan form tersembunyi saat awal. Hapus 'display:flex' yang bentrok */
    display: none; 
    
    /* Aturan lain untuk layout saat form terlihat */
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px; 
    background: white;
    padding: 1.8rem;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    max-height: 90vh; 
}

.form-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden; 
}

/* === Area Scroll untuk Form Registrasi === */
.form-fields-container {
    overflow-y: auto; 
    /* PERBAIKAN #2: Tinggi maksimal diperkecil agar scrollbar lebih mudah muncul untuk testing */
    max-height: 35vh; 
    padding-right: 15px; 
    margin-right: -15px;

    /* Styling untuk Firefox */
    scrollbar-width: thin; 
    scrollbar-color: #ccc #f1f1f1; 
}

/* Styling scrollbar untuk Chrome, Safari, Edge */
.form-fields-container::-webkit-scrollbar {
    width: 8px; 
}
.form-fields-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.form-fields-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
.form-fields-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}


.back-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.9rem; 
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem; 
    font-weight: 500;
    flex-shrink: 0; 
}

.back-btn:hover { color: #2563eb; }

.form-title {
    font-size: 1.8rem; 
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 0.25rem; 
    text-align: center;
    flex-shrink: 0;
}

.form-subtitle {
    color: #6b7280;
    font-size: 0.85rem; 
    font-weight: 400;
    text-align: center;
    margin-bottom: 1.25rem; 
    flex-shrink: 0;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem; 
    flex-grow: 1; 
    overflow: hidden; 
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem; 
}

.input-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.8rem; 
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.7rem 0.9rem; 
    border: 1px solid #d1d5db; 
    border-radius: 8px; 
    font-size: 0.85rem; 
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-options {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
}

.forgot-link, .terms-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.8rem; 
    font-weight: 500;
}

.forgot-link:hover, .terms-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: auto;
    margin: 0;
}

.checkmark {
    width: 16px; 
    height: 16px; 
    border: 1.5px solid #d1d5db; 
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background-color: #2563eb;
    border-color: #2563eb;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.7rem; 
    font-weight: bold;
}

.checkbox-text {
    font-size: 0.8rem; 
    color: #6b7280;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem; 
    border-radius: 10px; 
    font-size: 0.9rem; 
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.75rem; 
    width: 100%;
    flex-shrink: 0; 
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.error-message, .success-message {
    font-size: 0.8rem; 
    padding: 0.7rem; 
    border-radius: 6px;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    text-align: center;
    display: none; 
    flex-shrink: 0;
}

.error-message { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; }
.success-message { color: #065f46; background: #f0fdf4; border: 1px solid #bbf7d0; }

/* Responsive Design */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }
    .container {
        flex-direction: column;
        padding: 1rem;
    }
    .form-section, .info-section {
        max-width: 100%;
        margin-top: 2rem;
        /* PERBAIKAN: Pastikan form tidak melebihi tinggi layar di mobile */
        max-height: none;
    }
    .welcome-title {
        font-size: 1.75rem;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
}
/* === SPINNER LOADING UNTUK LOGIN === */
.btn-primary.loading,
.btn-google.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-primary.loading::after,
.btn-google.loading::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    transform: translateY(-50%);
    animation: spin 0.8s linear infinite;
}

.btn-google.loading::after {
    border-color: #333;
    border-top-color: transparent;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}
/* Spinner agar sejajar di tombol login */
.btn-loader {
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
}
.btn-loader i {
  font-size: 1rem;
}
