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

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #f0efe9;
    color: #0b486b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.logo-container {
    display: inline-block;
}

.logo {
    max-width: 300px;
    height: auto;
    display: block;
    width: 100%;
}

.logo-container {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

main {
    width: 100%;
}

.form-wrapper {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

h1 {
    color: #0b486b;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

.subtitle {
    color: #357388;
    font-size: 14px;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.5;
}

.required-note {
    color: #6b6b6b;
    font-size: 12px;
    text-align: left;
    margin-bottom: 30px;
    line-height: 1.5;
}

form {
    width: 100%;
}

.form-group {
    margin-bottom: 0;
}

label {
    display: block;
    color: #6b6b6b;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.required-indicator {
    color: #d32f2f;
    font-weight: 600;
    margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="date"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 16px;
    font-family: 'Open Sans', sans-serif;
    color: #6b6b6b;
    background-color: #ffffff;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #0b486b;
    box-shadow: 0 0 0 3px rgba(11, 72, 107, 0.1);
}

/* Only show invalid styling after user has interacted with the field */
input[type="text"].touched:invalid,
input[type="email"].touched:invalid,
input[type="date"].touched:invalid,
select.touched:invalid {
    border-color: #d32f2f;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b6b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.error-message {
    display: block;
    color: #d32f2f;
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
}

.form-alert {
    margin-top: 24px;
    padding: 16px 18px;
    border-radius: 4px;
    line-height: 1.5;
}

.form-alert-error {
    background-color: #ffebee;
    border: 1px solid #ef5350;
    color: #c62828;
}

.form-alert-message {
    font-size: 14px;
    margin-bottom: 10px;
}

.form-alert-message:last-child {
    margin-bottom: 0;
}

.form-alert-tip {
    font-size: 13px;
    color: #8e2424;
    font-style: italic;
    margin-bottom: 0;
    padding-top: 2px;
    border-top: 1px solid rgba(239, 83, 80, 0.35);
}

.submit-button {
    width: 100%;
    padding: 14px 24px;
    background-color: #0b486b;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

.submit-button:hover:not(:disabled) {
    background-color: #083a56;
}

.submit-button:active:not(:disabled) {
    background-color: #062d42;
}

.submit-button:disabled {
    background-color: #6b6b6b;
    cursor: not-allowed;
    opacity: 0.7;
}

.message {
    margin-top: 24px;
    padding: 16px;
    border-radius: 4px;
    text-align: center;
}

.success-message {
    background-color: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.success-message p {
    margin-bottom: 8px;
}

.success-message p:last-child {
    margin-bottom: 0;
}

.success-message strong {
    font-weight: 600;
}


.helper-text {
    display: block;
    color: #6b6b6b;
    font-size: 12px;
    font-weight: 400;
    font-style: italic;
    margin-top: 2px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
}

.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-error {
    background-color: #ffebee;
    border: 1px solid #ef5350;
    color: #c62828;
}

.toast-success {
    background-color: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.toast-warning {
    background-color: #fff8e1;
    border: 1px solid #ffca28;
    color: #f57f17;
}

.toast-message {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
}

.toast-close:hover {
    opacity: 1;
}

body.overlay-open {
    overflow: hidden;
}

.redirect-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: rgba(11, 72, 107, 0.85);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.redirect-overlay.redirect-overlay-visible {
    display: flex;
    pointer-events: auto;
    opacity: 1;
}

.redirect-overlay-content {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 40px 32px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(12px);
    transition: transform 0.35s ease;
}

.redirect-overlay-visible .redirect-overlay-content {
    transform: translateY(0);
}

.redirect-overlay-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    border-radius: 50%;
    background-color: #e8f5e9;
    color: #2e7d32;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.redirect-overlay-content h2 {
    color: #0b486b;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.redirect-overlay-content p {
    color: #357388;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.redirect-overlay-subtext {
    color: #6b6b6b;
    font-size: 14px;
    font-style: italic;
    margin-bottom: 0 !important;
}

footer {
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    padding: 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.copyright {
    color: #6b6b6b;
    font-size: 13px;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #357388;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #0b486b;
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .form-wrapper {
        padding: 30px 20px;
    }

    h1 {
        font-size: 24px;
    }

    .logo {
        max-width: 250px;
    }

    .footer-links {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .form-wrapper {
        padding: 25px 15px;
    }

    h1 {
        font-size: 22px;
    }

    .logo {
        max-width: 200px;
    }
}
