/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #E87511;
    --secondary: #F4A524;
    --dark: #C25E0A;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --red: #ef4444;
    --green: #22c55e;
    --yellow: #eab308;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--white);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
    width: 100%;
}

/* ===== NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.05);
}

.nav-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-link {
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(232, 117, 17, 0.06);
}

.nav-link.active {
    color: var(--white);
    background: var(--primary);
}

.nav-login {
    margin-left: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    width: 24px;
    height: 2.5px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== MAIN LOGIN PAGE ===== */
.login-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: var(--gray-50);
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 1040px;
    min-height: 620px;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

/* ===== FORM SECTION ===== */
.form-section {
    flex: 1;
    padding: 3rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.form-card {
    width: 100%;
    max-width: 420px;
    animation: fadeSlideIn 0.4s ease;
}

.form-card.hidden {
    display: none;
}

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

.form-header {
    margin-bottom: 1.75rem;
}

.form-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.35rem;
}

.form-header p {
    color: var(--gray-500);
    font-size: 0.95rem;
}

/* ===== ROLE TABS ===== */
.role-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    background: var(--gray-100);
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.register-roles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    overflow-x: visible;
}

.register-roles .role-tab {
    flex: unset;
    min-width: 0;
    font-size: 0.72rem;
    padding: 0.55rem 0.4rem;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
}

.role-tab {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-500);
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
}

.role-tab:hover {
    color: var(--gray-700);
}

.role-tab.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
}

.reg-user-hint {
    font-size: 0.82rem;
    color: var(--gray-600);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.45;
}

/* ===== FORM GROUPS ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0 1rem;
    transition: var(--transition);
    background: var(--white);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 117, 17, 0.1);
}

.input-wrapper.error {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--gray-400);
    margin-right: 0.75rem;
}

.input-wrapper input {
    padding: 0.8rem 0;
    font-size: 0.9rem;
    color: var(--gray-800);
    background: transparent;
}

.input-wrapper input::placeholder {
    color: var(--gray-400);
}

.toggle-password {
    padding: 0.4rem;
    color: var(--gray-400);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.toggle-password:hover {
    color: var(--gray-600);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.error-msg {
    display: block;
    font-size: 0.78rem;
    color: var(--red);
    margin-top: 0.3rem;
    min-height: 1rem;
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    height: 4px;
    flex: 1;
    background: var(--gray-200);
    border-radius: 2px;
    transition: var(--transition);
}

.strength-bar.weak { background: var(--red); }
.strength-bar.medium { background: var(--yellow); }
.strength-bar.strong { background: var(--green); }

.strength-text {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 50px;
}

.strength-text.weak { color: var(--red); }
.strength-text.medium { color: var(--yellow); }
.strength-text.strong { color: var(--green); }

/* ===== FORM OPTIONS ===== */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--dark);
}

.terms-link {
    color: var(--primary);
    font-weight: 500;
}

.terms-link:hover {
    text-decoration: underline;
}

/* ===== PRIMARY BUTTON ===== */
.btn-primary {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary), var(--dark));
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(232, 117, 17, 0.35);
}

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

.btn-loader {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ===== FORM ALERT ===== */
.form-alert {
    margin-top: 1rem;
    padding: 0;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
    overflow: hidden;
    max-height: 0;
}

.form-alert.show {
    padding: 0.75rem 1rem;
    max-height: 100px;
    margin-top: 1rem;
}

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

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

.form-alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.form-alert.show.info {
    max-height: 160px;
}

/* ===== FORM FOOTER ===== */
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.form-footer p {
    font-size: 0.9rem;
    color: var(--gray-500);
}

.form-footer a {
    color: var(--primary);
    font-weight: 600;
    transition: var(--transition);
}

.form-footer a:hover {
    color: var(--dark);
}

/* ===== DECORATIVE PANEL ===== */
.deco-panel {
    width: 420px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 50%, #a14e08 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.deco-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

.deco-panel::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(244, 165, 36, 0.2) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite 2s;
}

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

.deco-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    color: var(--white);
}

.deco-pattern {
    margin-bottom: 2rem;
}

.deco-circle {
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
}

.deco-circle:nth-child(1) {
    width: 120px;
    height: 120px;
    animation: float 6s ease-in-out infinite;
}

.deco-circle:nth-child(2) {
    width: 80px;
    height: 80px;
    margin-top: -40px;
    border-color: rgba(255, 255, 255, 0.15);
    animation: float 6s ease-in-out infinite 1s;
}

.deco-circle:nth-child(3) {
    width: 50px;
    height: 50px;
    margin-top: -25px;
    border-color: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.deco-brand {
    margin-bottom: 1.5rem;
}

.deco-ik {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.deco-brand h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.deco-tagline {
    font-size: 1.05rem;
    opacity: 0.85;
    line-height: 1.6;
    max-width: 280px;
    margin: 0 auto;
}

.deco-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 2rem;
}

.deco-dots span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

.deco-dots span:nth-child(2) {
    background: rgba(255, 255, 255, 0.7);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
}

.footer-container {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer p {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--gray-500);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .nav-link {
        font-size: 0.82rem;
        padding: 0.45rem 0.6rem;
    }
}

@media (max-width: 900px) {
    .deco-panel {
        display: none;
    }

    .login-container {
        max-width: 500px;
        border-radius: 16px;
    }

    .form-section {
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 5rem 1.5rem 2rem;
        gap: 0.25rem;
        box-shadow: var(--shadow-xl);
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .nav-menu.open {
        right: 0;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .nav-login {
        margin-left: 0;
        text-align: center;
        margin-top: 0.5rem;
    }

    .login-page {
        padding: 1.5rem 1rem;
    }

    .login-container {
        border-radius: 16px;
        min-height: auto;
    }

    .form-section {
        padding: 2rem 1.5rem;
    }

    .form-header h1 {
        font-size: 1.5rem;
    }

    .role-tabs {
        flex-wrap: wrap;
    }

    .register-roles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .role-tab {
        font-size: 0.75rem;
        padding: 0.5rem 0.6rem;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .form-section {
        padding: 1.5rem 1.25rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Register extras */
.form-card .hidden,
.reg-field-admin.hidden {
    display: none !important;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-row-phone {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.75fr) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.register-form-scroll {
    max-height: min(62vh, 520px);
    overflow-y: auto;
    padding-right: 4px;
}

.select-wrapper select {
    width: 100%;
    border: none;
    background: transparent;
    font: inherit;
    color: var(--gray-800);
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    outline: none;
}

@media (max-width: 540px) {
    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .form-row-phone {
        grid-template-columns: 1fr;
    }
}

.reg-field-hint {
    font-size: 0.8rem;
    color: var(--gray-500, #64748b);
    margin: 0.25rem 0 0.5rem;
    line-height: 1.4;
}

.required-star {
    color: #dc2626;
}

.teacher-check-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 8px;
    background: var(--gray-50, #f8fafc);
}

.teacher-check-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--gray-200, #e2e8f0);
    cursor: pointer;
    font-size: 0.9rem;
}

.teacher-check-row input {
    margin: 0;
}

.teacher-check-name {
    font-weight: 500;
    color: var(--gray-800, #1e293b);
}

.teacher-check-email {
    font-size: 0.78rem;
    color: var(--gray-500, #64748b);
    width: 100%;
    padding-left: 1.4rem;
}

.teacher-check-list .muted {
    margin: 0;
    font-size: 0.85rem;
    color: var(--gray-500, #64748b);
}
