/* ==============================
   UNIFIED AUTH SYSTEM 
   ============================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px; /* Base for rem units (1rem = 16px) */
}

body {
    font-family: 'Inter', sans-serif;
    background: #ffffff;
    height: 100vh;
    overflow: hidden;
}

/* ================= RESPONSIVE SPLIT CONTAINER (FLEX) ================= */
.split-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

.left-side {
    flex: 1;
    background: url('../images/logoR.png') center/cover no-repeat;
    position: sticky;
    top: 0;
}

.right-side {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: transparent;
}

/* Custom Scrollbar (preserved) */
.right-side::-webkit-scrollbar {
    width: 6px;
}
.right-side::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.right-side::-webkit-scrollbar-thumb {
    background: #1a3a6e;
    border-radius: 10px;
}
.right-side::-webkit-scrollbar-thumb:hover {
    background: #0B2B5C;
}

/* Auth Card - uses relative max-width for responsiveness */
.auth-card {
    width: 100%;
    max-width: 450px;
    margin: auto;
    background: transparent;
}

/* Brand Section */
.brand-section {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid rgba(11, 43, 92, 0.12);
}

.brand-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(145deg, #0a1e3a, #05152c);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px auto;
    box-shadow: 0 15px 25px -8px rgba(2, 10, 25, 0.35);
    transition: transform 0.2s ease;
}

.brand-icon:hover {
    transform: scale(1.02);
}

.brand-icon i {
    font-size: 34px;
    color: #f0f4ff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.brand-section h1 {
    font-size: 30px;
    font-weight: 800;
    background: linear-gradient(135deg, #05152c, #1a3a6e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.brand-description {
    font-size: 13px;
    color: #5a6e8a;
    line-height: 1.5;
    font-weight: 500;
}

.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.form-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0a1e3a;
    margin-bottom: 8px;
}

.form-header p {
    font-size: 13px;
    color: #7c8ea8;
    font-weight: 500;
}

/* Input Groups - responsive touch targets */
.input-group {
    margin-bottom: 24px;
}

.input-label {
    font-size: 13px;
    font-weight: 600;
    color: #0a1e3a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-label i {
    color: #1a3a6e;
    font-size: 14px;
    width: 18px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 44px 14px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    background: #FFFFFF;
    transition: all 0.2s ease;
    color: #0a1e3a;
    outline: none;
}

.input-wrapper input:focus {
    border-color: #0B2B5C;
    box-shadow: 0 0 0 3px rgba(11, 43, 92, 0.12);
}

.input-wrapper input::placeholder {
    color: #9AA6BF;
    font-weight: 400;
}

/* General input styling */
input:not(.input-wrapper input) {
    width: 100%;
    padding: 14px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    background: #FFFFFF;
    transition: all 0.2s ease;
    color: #0a1e3a;
    outline: none;
}

input:not(.input-wrapper input):focus {
    border-color: #0B2B5C;
    box-shadow: 0 0 0 3px rgba(11, 43, 92, 0.12);
}

input:not(.input-wrapper input)::placeholder {
    color: #9AA6BF;
    font-weight: 400;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #8A99B4;
    font-size: 18px;
    transition: all 0.2s ease;
}

.toggle-password:hover {
    color: #0B2B5C;
    transform: translateY(-50%) scale(1.1);
}

/* Radio Group - touch friendly */
.radio-group {
    display: flex;
    gap: 28px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #0a1e3a;
    cursor: pointer;
    font-weight: 500;
    padding: 4px 0; /* Improves touch area */
}

.radio-group input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0B2B5C;
}

/* Primary Button - touch friendly */
.btn-primary {
    width: 100%;
    padding: 15px;
    border-radius: 40px;
    border: none;
    background: linear-gradient(145deg, #0a1e3a, #0B2B5C);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(2, 10, 25, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(2, 10, 25, 0.25);
    background: linear-gradient(145deg, #0B2B5C, #0a1e3a);
}

.btn-primary:active {
    transform: translateY(1px);
}

.back-link,
.links-row {
    text-align: center;
    margin-top: 22px;
}

.back-link a,
.links-row a {
    color: #5a6e8a;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    gap: 6px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link a:hover,
.links-row a:hover {
    color: #0B2B5C;
}

.links-row {
    display: flex;
    justify-content: space-between;
}

/* ================= MODAL NOTIFICATION STYLES (Centered + Responsive) ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification-modal {
    background: white;
    border-radius: 24px;
    padding: 32px 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.notification-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    font-size: 32px;
}

.notification-modal.success .notification-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.notification-modal.error .notification-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.notification-modal.info .notification-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.notification-modal h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1f2937;
}

.notification-modal p {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 28px;
}

.modal-button {
    padding: 12px 28px;
    border-radius: 40px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(145deg, #0a1e3a, #0B2B5C);
    color: white;
}

.modal-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(11, 43, 92, 0.3);
}
.modal-button:active {
    transform: translateY(0);
}

/* Message Banner (Fallback) */
.message-banner {
    padding: 12px 16px;
    border-left: 4px solid #e5484d;
    background: #fef2f0;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: #c2410c;
    align-items: center;
}
.success-banner {
    border-left-color: #30a46c;
    background: #e9f9ef;
    color: #2b6e3c;
}
.message-banner i {
    font-size: 16px;
}

/* ============================================
   RESPONSIVE DESIGN SYSTEM
   Flexbox, Grid, Media Queries
   Preserves original design, adds responsiveness
   ============================================ */

/* RESPONSIVE BASE: Fluid images and text scaling */
img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* BUTTON TOUCH-FRIENDLY: Minimum tap target size 44x44px */
button, 
.btn-primary, 
.modal-button,
.toggle-password,
.back-link a,
.links-row a,
.radio-group label {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Adjust toggle-password to maintain position with min touch size */
.toggle-password {
    min-width: 44px;
    min-height: 44px;
    right: 8px; /* slight adjustment for larger hit area */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== MEDIA QUERY: LAPTOP / DESKTOP (max-width: 1024px) ========== */
@media (max-width: 1024px) {
    .auth-card {
        max-width: 420px;
    }
    
    .brand-section h1 {
        font-size: 28px;
    }
    
    .brand-icon {
        width: 65px;
        height: 65px;
    }
    
    .brand-icon i {
        font-size: 32px;
    }
    
    .right-side {
        padding: 32px 24px;
    }
}

/* ========== MEDIA QUERY: TABLET (max-width: 768px) ========== */
@media (max-width: 768px) {
    /* Split container stacks vertically on tablet */
    .split-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .left-side {
        height: 220px; /* Preserved visual proportion */
        flex: none;
        width: 100%;
        position: relative;
        background-position: center;
    }

    body {
        overflow: auto;
        height: auto;
    }

    .right-side {
        height: auto;
        padding: 30px 20px;
        overflow-y: visible;
    }

    .auth-card {
        max-width: 480px; /* Wider on tablet for readability */
        margin: 0 auto;
    }
    
    /* Improve spacing */
    .brand-section {
        margin-bottom: 28px;
        padding-bottom: 20px;
    }
    
    .form-header {
        margin-bottom: 28px;
    }
    
    .radio-group {
        gap: 24px;
    }
    
    /* Links row remains flexible */
    .links-row {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
    }
}

/* ========== MEDIA QUERY: MOBILE (max-width: 480px) ========== */
@media (max-width: 480px) {
    /* Single column stacked layout */
    .auth-card {
        padding: 0 12px;
        max-width: 100%;
    }

    .brand-icon {
        width: 58px;
        height: 58px;
    }
    
    .brand-icon i {
        font-size: 28px;
    }

    .brand-section h1 {
        font-size: 26px;
    }
    
    .brand-description {
        font-size: 12px;
    }
    
    .form-header h2 {
        font-size: 20px;
    }
    
    .form-header p {
        font-size: 12px;
    }
    
    /* Input fields more comfortable on mobile */
    .input-wrapper input,
    input:not(.input-wrapper input) {
        padding: 14px 44px 14px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-primary {
        padding: 14px;
        font-size: 15px;
    }
    
    /* Radio group stacks vertically cleanly */
    .radio-group {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .radio-group label {
        font-size: 15px;
        padding: 6px 0;
    }
    
    .links-row {
        flex-direction: column;
        gap: 14px;
        align-items: center;
    }
    
    .back-link a,
    .links-row a {
        font-size: 14px;
        padding: 6px 0;
    }
    
    /* Modal adjustments for small screens */
    .notification-modal {
        padding: 24px 20px;
        max-width: 320px;
        width: 90%;
    }
    
    .notification-icon {
        width: 56px;
        height: 56px;
        font-size: 26px;
    }
    
    .notification-modal h3 {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .notification-modal p {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .modal-button {
        padding: 10px 24px;
        font-size: 14px;
    }
    
    /* Left side image on mobile: smaller but remains visible */
    .left-side {
        height: 180px;
    }
    
    .right-side {
        padding: 24px 16px;
    }
}

/* ========== EXTRA SMALL DEVICES (max-width: 360px) ========== */
@media (max-width: 360px) {
    .brand-icon {
        width: 52px;
        height: 52px;
    }
    
    .brand-icon i {
        font-size: 24px;
    }
    
    .brand-section h1 {
        font-size: 24px;
    }
    
    .btn-primary {
        padding: 12px;
        font-size: 14px;
    }
    
    .right-side {
        padding: 20px 12px;
    }
    
    .notification-modal {
        padding: 20px 16px;
    }
}

/* ========== LANDSCAPE MODE FOR MOBILES ========== */
@media (max-width: 768px) and (orientation: landscape) {
    .split-container {
        flex-direction: row;
    }
    
    .left-side {
        height: 100vh;
        width: 40%;
        flex: none;
    }
    
    .right-side {
        width: 60%;
        height: 100vh;
        overflow-y: auto;
    }
    
    .auth-card {
        max-width: 380px;
        padding: 0 8px;
    }
    
    .brand-icon {
        width: 50px;
        height: 50px;
    }
    
    .brand-icon i {
        font-size: 26px;
    }
    
    .brand-section h1 {
        font-size: 24px;
    }
    
    .radio-group {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ========== ENSURE NO HORIZONTAL SCROLLING ========== */
body, .split-container, .right-side, .auth-card {
    overflow-x: hidden;
}

/* Tables (if any in future) - horizontal scroll only if needed */
.responsive-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Improve consistency on all devices */
@media (min-width: 1400px) {
    .auth-card {
        max-width: 500px;
    }
    
    .right-side {
        padding: 48px 32px;
    }
}