/* Universal box-sizing fix */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body - Full viewport layout */
body {
    margin: 0;
    padding: 15px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #e8efff, #f6f9ff);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Form container - Responsive width */
.form-container {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    padding: 40px 35px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.form-container:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Heading */
h2 {
    margin: 0 0 30px;
    text-align: center;
    color: #003b73;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

/* Form wrapper */
form {
    width: 100%;
}

/* Labels */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #002952;
    letter-spacing: 0.01em;
}

/* All form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    margin-bottom: 20px;
    background: #f8fafc;
    transition: all 0.2s ease;
    color: #1e293b;
    line-height: 1.5;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Select dropdown arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath fill='%23002952' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px;
    padding-right: 45px;
    cursor: pointer;
}

/* Input placeholder */
input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

/* Focus states */
input:focus,
select:focus {
    border-color: #2563eb;
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Disabled state */
input:disabled,
select:disabled {
    background: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Submit button */
button[type="submit"],
button {
    width: 100%;
    height: 52px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    background: #003b73;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 10px;
    letter-spacing: 0.02em;
    -webkit-tap-highlight-color: transparent;
}

button[type="submit"]:hover,
button:hover {
    background: #005bbf;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 59, 115, 0.3);
}

button[type="submit"]:active,
button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 59, 115, 0.2);
}

button[type="submit"]:disabled,
button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Alert messages */
.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

/* Footer text and links */
p,
.small-text {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

p a,
.small-text a {
    color: #003b73;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

p a:hover,
.small-text a:hover {
    color: #005bbf;
    border-bottom-color: #005bbf;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Large tablets and small desktops (768px - 1024px) */
@media (max-width: 1024px) {
    .form-container {
        max-width: 400px;
    }
}

/* Tablets (481px - 768px) */
@media (max-width: 768px) {
    body {
        padding: 20px;
    }
    
    .form-container {
        max-width: 500px;
        padding: 35px 30px;
    }
    
    h2 {
        font-size: 26px;
        margin-bottom: 25px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select {
        height: 46px;
        font-size: 15px;
    }
    
    button[type="submit"],
    button {
        height: 50px;
        font-size: 16px;
    }
}

/* Mobile devices (320px - 480px) */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .form-container {
        padding: 28px 24px;
        border-radius: 14px;
    }
    
    h2 {
        font-size: 24px;
        margin-bottom: 22px;
    }
    
    label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select {
        height: 48px;
        font-size: 16px; /* Prevents iOS zoom */
        padding: 12px 14px;
        margin-bottom: 18px;
    }
    
    select {
        background-position: right 14px center;
        padding-right: 42px;
    }
    
    button[type="submit"],
    button {
        height: 52px;
        font-size: 16px;
        margin-top: 8px;
    }
    
    .alert {
        padding: 12px 14px;
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    p,
    .small-text {
        font-size: 13px;
        margin-top: 20px;
    }
}

/* Small mobile devices (240px - 360px) */
@media (max-width: 360px) {
    body {
        padding: 10px;
    }
    
    .form-container {
        padding: 24px 20px;
        border-radius: 12px;
    }
    
    h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select {
        height: 46px;
        padding: 10px 12px;
        margin-bottom: 16px;
    }
    
    button[type="submit"],
    button {
        height: 50px;
        font-size: 15px;
    }
}

/* Very small devices (below 320px) */
@media (max-width: 320px) {
    .form-container {
        padding: 20px 16px;
    }
    
    h2 {
        font-size: 20px;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 10px;
    }
    
    .form-container {
        padding: 20px 25px;
        margin: 10px auto;
    }
    
    h2 {
        font-size: 22px;
        margin-bottom: 16px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select {
        height: 42px;
        margin-bottom: 14px;
    }
    
    button[type="submit"],
    button {
        height: 46px;
        margin-top: 6px;
    }
}

/* High DPI screens (Retina displays) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select {
        border-width: 1.5px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .form-container {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    button {
        display: none;
    }
}