/* ============================================
   GENERAL STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER STYLES
   ============================================ */

.header {
    background: linear-gradient(135deg, #003366 0%, #004a80 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header-content p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    flex: 1;
    padding: 40px 20px;
}

.form-section {
    max-width: 1000px;
    margin: 0 auto;
}

.form-container {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.form-container h2 {
    color: #003366;
    margin-bottom: 10px;
    font-size: 2em;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.05em;
}

/* ============================================
   MESSAGE CONTAINER
   ============================================ */

#message-container {
    margin-bottom: 20px;
    display: none;
}

.message {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   FORM STYLES
   ============================================ */

form {
    margin: 0;
}

fieldset {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    background-color: #f9f9f9;
}

legend {
    background: linear-gradient(135deg, #003366 0%, #004a80 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1.2em;
    margin-left: -25px;
    margin-bottom: 20px;
    width: calc(100% + 50px);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #fbfbfb;
}

.form-group input[type="file"] {
    padding: 10px 15px;
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    color: #999;
    margin-top: 5px;
    font-size: 0.9em;
}

/* ============================================
   CHECKBOX STYLE
   ============================================ */

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.form-group.checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-bottom: 0;
}

.form-group.checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

/* ============================================
   REQUIED FIELD INDICATOR
   ============================================ */

.form-group label::after {
    content: "";
}

label:has(+ input[required])::after,
label:has(+ select[required])::after,
label:has(+ textarea[required])::after {
    content: " *";
    color: #e74c3c;
    font-weight: bold;
}

/* ============================================
   BUTTONS
   ============================================ */

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    justify-content: center;
}

.btn {
    padding: 12px 40px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 4px solid #667eea;
}

.footer p {
    margin: 10px 0;
}

.footer a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.8em;
    }

    .form-container {
        padding: 20px;
    }

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

    fieldset {
        padding: 15px;
    }

    legend {
        width: 100%;
        margin-left: 0;
        margin-bottom: 15px;
        font-size: 1em;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .main-content {
        padding: 20px 10px;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5em;
    }

    .header-content p {
        font-size: 1em;
    }

    .form-container {
        padding: 15px;
        border-radius: 5px;
    }

    .container {
        background: #f5f5f5;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .btn,
    .form-actions {
        display: none;
    }

    body {
        background: white;
    }

    .form-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
