/* style.css - External stylesheet for certificate management system */

/* Global Typography */
body {
    font-family: 'Lato', sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0;
    color: #4f4f4f;
    background-color: #ffffff;
    padding: 20px;
}

/* Container for overall site width */
.container {
    max-width: 1140px;
    width: 95%;
    margin: 0 auto;
}

/* Header with Logo and Top Menu */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

header .logo img {
    max-width: 240px;
}

/* Navigation */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 30px;
}

nav ul li:first-child {
    margin-left: 0;
}

nav ul li a {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    color: #0c3e66;
    text-decoration: none;
}

nav ul li a:hover {
    color: #f7ab42;
    text-decoration: underline;
}

/* Headings */
h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 38px;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 0;
    margin-bottom: 1em;
    letter-spacing: -0.015em;
    color: #222222;
}

h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 1.33em;
    margin-bottom: 1.1em;
    letter-spacing: -0.015em;
    color: #222222;
    text-align: center;
}

/* Links */
a {
    color: #009fe3;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Form Styles */
form {
    background-color: #f5f5f5;
    padding: 40px 60px;
    border-radius: 6px;
    max-width: 600px;
    margin: 0 auto 60px auto;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input, select {
    width: 100%;
    height: 44px;
    padding: 0 15px;
    margin-bottom: 15px;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    font-size: 16px;
    background-color: #ffffff;
    color: #4f4f4f;
}

/* ADDED: Specific styling for date inputs to ensure full width on all devices */
input[type="date"] {
    -webkit-appearance: none; /* Removes default iOS styling */
    appearance: none; 
    min-width: 100%; /* Additional enforcement of width */
    box-sizing: border-box; /* Ensures padding doesn't expand width */
}

input:focus, select:focus {
    border-color: #0c3e66;
    outline: none;
    box-shadow: 0 0 3px rgba(12, 62, 102, 0.3);
}

/* Button Styles */
button {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 13px 29px;
    margin-top: 30px;
    background-color: #3d6585;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* ADDED: Force submit button to always appear on a new line */
button[type="submit"] {
    display: block; /* Ensures the button is a block element */
    clear: both; /* Prevents floating beside other elements */
    width: auto; /* Allows button to size naturally based on text */
    min-width: 200px; /* Ensures minimum width for the button */
    margin-left: 0; /* Aligns with left side of form */
}

button:hover {
    background-color: #f7ab42;
    color: #ffffff;
}

/* Message Styles */
.message {
    max-width: 600px;
    margin: 20px auto 40px auto;
    padding: 30px;
    border-radius: 6px;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Field-specific error messages */
.field-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 8px 12px;
    margin: -5px 0 15px 0;
    font-size: 14px;
}

/* Add a red border to invalid inputs */
input.invalid, select.invalid {
    border-color: #dc3545;
}

/* Improve spacing in the form */
label {
    margin-top: 15px;
}

/* First label shouldn't have the top margin */
form label:first-of-type {
    margin-top: 0;
}

/* Login Form Styles */
.login-error {
    max-width: 420px;
    margin: 0 auto 40px auto;
    text-align: center;
}

.login-form {
    max-width: 300px;
    margin: auto;
}

.login-form label, 
.login-form input, 
.login-form button {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        font-size: 18px;
    }
    
    form {
        padding: 25px 30px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
    }
    
    header .logo {
        margin-bottom: 15px;
    }
    
    nav ul {
        justify-content: center;
    }
    
    h2 {
        font-size: 28px;
    }
    
    /* ADDED: Ensure date inputs take full width on mobile/tablet devices */
    input[type="date"] {
        width: 100%;
        min-width: 100%;
    }
    
    /* ADDED: Ensure proper button styling on mobile */
    button[type="submit"] {
        width: 100%; /* Full width button on mobile */
        max-width: none; /* Remove max-width limitation */
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
        padding: 10px;
    }
    
    form {
        padding: 20px;
    }
    
    button {
        width: 100%;
    }
    
    /* ADDED: Additional fixes for very small screens */
    input, select {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 0 10px; /* Slightly reduce padding */
    }
}