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

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    color: var(--text-dark);
}

/* Dynamic Gradient Background */
.bg-gradient {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--dole-red) 0%, var(--dole-blue) 100%);
    background-attachment: fixed;
}

/* Glassmorphic Card */
.card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 40px 30px;
    border-radius: 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.6s ease-out;
}

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

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, var(--dole-red), var(--dole-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: #64748b;
    padding-left: 4px;
}

input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 16px; /* Prevents iOS Zoom */
    background: white;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--dole-blue);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
    outline: none;
}

/* Modern Button */
.btn-primary {
    background: var(--dole-blue);
    color: white;
    border: none;
    padding: 16px;
    width: 100%;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    background: #1e3a8a;
}

.footer-link {
    display: block;
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link span {
    color: var(--dole-blue);
    font-weight: 600;
}
/* Sidebar Layout Container */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--dole-blue);
    color: white;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: all 0.3s ease;
}

.sidebar-logo {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 40px;
    padding-left: 10px;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.content-area {
    flex-grow: 1;
    background: #f1f5f9;
    padding: 30px;
    overflow-y: auto;
}

/* Responsive Mobile Sidebar (iOS) */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        width: 100%;
        height: 70px;
        flex-direction: row;
        padding: 0 10px;
        z-index: 1000;
    }
    .sidebar-logo { display: none; }
    .nav-links {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        width: 100%;
    }
    .nav-link {
        flex-direction: column;
        font-size: 10px;
        padding: 8px;
        gap: 4px;
    }
    .content-area {
        padding: 20px;
        padding-bottom: 90px; /* Space for bottom nav */
    }
    .radio-box {
    display: block;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.radio-box:has(input:checked) {
    border-color: var(--dole-blue);
    background: #eff6ff;
    color: var(--dole-blue);
}
.radio-box input { width: auto; margin-right: 8px; }
}
/* Add to your existing CSS */
    .register-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .file-upload-wrapper {
        background: #f8fafc;
        padding: 20px;
        border-radius: 16px;
        border: 2px dashed #cbd5e1;
        margin-bottom: 20px;
        text-align: center;
    }

    .file-upload-wrapper input[type="file"] {
        border: none;
        padding: 10px 0;
        background: transparent;
        font-size: 13px;
    }

    .btn-secondary {
        display: block;
        text-decoration: none;
        text-align: center;
        padding: 16px;
        border-radius: 14px;
        font-weight: 700;
        background: #f1f5f9;
        color: #64748b;
        margin-top: 10px;
        transition: all 0.2s;
    }

    .btn-secondary:hover {
        background: #e2e8f0;
    }

    @media (max-width: 600px) {
        .register-grid { grid-template-columns: 1fr; }
    }
     /* Ensure the buttons feel consistent with your existing CSS */
    .btn-primary {
        box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(30, 64, 175, 0.4);
        background: #1e3a8a; /* Darker blue from your root */
    }

    .btn-secondary {
        transition: all 0.2s ease;
    }

    .btn-secondary:hover {
        background: #f8fafc !important;
        border-color: #cbd5e1 !important;
        color: var(--text-dark) !important;
        transform: translateY(-1px);
    }
     /* Alert Micro-Styling */
    .alert {
        padding: 14px;
        border-radius: 16px;
        font-size: 13.5px;
        text-align: center;
        margin-bottom: 25px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        animation: fadeIn 0.4s ease-out;
    }
    .alert-warning { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; }
    .alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
    .alert-danger { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }

    /* Login Specific Container */
    .container {
        width: 100%;
        max-width: 400px;
        perspective: 1000px;
    }

    .login-footer {
        text-align: center;
        margin-top: 25px;
        padding-top: 20px;
        border-top: 1px solid rgba(226, 232, 240, 0.6);
    }

    .action-badge {
        font-size: 13px;
        color: var(--dole-blue);
        text-decoration: none;
        font-weight: 700;
        background: rgba(30, 64, 175, 0.08);
        padding: 12px 20px;
        border-radius: 12px;
        display: inline-block;
        transition: all 0.2s ease;
        border: 1px solid transparent;
    }

    .action-badge:hover {
        background: rgba(30, 64, 175, 0.12);
        border-color: rgba(30, 64, 175, 0.2);
        transform: translateY(-1px);
    }
    /* Specific responsiveness for 365x667 and smaller mobile screens */
@media (max-width: 400px) {
    /* 1. Scale down the Card Padding */
    .card, .glass-card {
        padding: 25px 20px !important;
        border-radius: 20px;
    }

    /* 2. Compact Header and Titles */
    .logo-container h2 {
        font-size: 22px !important;
    }
    
    .logo-container {
        margin-bottom: 20px;
    }

    /* 3. Optimize Forms for Small Height (667px) */
    input, .input-modern, select {
        padding: 12px 14px !important;
        font-size: 15px !important; /* Slightly smaller to prevent text cutoff */
    }

    .form-group {
        margin-bottom: 15px;
    }

    .btn-primary {
        padding: 14px !important;
        font-size: 14px !important;
    }

    /* 4. Fix Bottom Navigation for 365px width */
    .sidebar {
        height: 65px !important; /* Slightly shorter bottom bar */
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .nav-link {
        padding: 5px !important;
    }

    .nav-link ion-icon {
        font-size: 20px !important;
    }

    .nav-link span {
        font-size: 9px !important;
        letter-spacing: 0;
    }

    /* 5. Content Area Adjustments */
    .content-area {
        padding: 15px !important;
        padding-bottom: 80px !important; /* Ensure content isn't hidden by nav */
    }

    header h1 {
        font-size: 18px !important;
    }

    /* 6. Success ID Screen - Scale the large ID text */
    .id-display h1 {
        font-size: 2.5rem !important;
        letter-spacing: 2px !important;
    }
    
    .id-display {
        padding: 15px !important;
    }

    /* 7. Grid Fixes for Registration */
    .register-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* Fix for very short screens to allow scrolling on the login card */
@media (max-height: 700px) {
    .bg-gradient {
        align-items: flex-start; /* Align to top so bottom isn't cut off */
        padding-top: 40px;
        padding-bottom: 100px;
    }
}