
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #080d18;
    --surface: #111a2b;
    --surface-light: #172338;
    --border: rgba(255, 255, 255, 0.09);
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #f59e0b;
    --accent-hover: #fbbf24;
    --danger: #fb7185;
    --success: #4ade80;
}

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

body {
    min-height: 100vh;
    padding: 20px;
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    background:
        radial-gradient(ellipse at 15% 15%, rgba(37, 99, 235, 0.14), transparent 40%),
        radial-gradient(ellipse at 85% 85%, rgba(245, 158, 11, 0.09), transparent 40%),
        var(--bg);
}

/* Main container */

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Application card */

.apply-box {
    width: 100%;
    max-width: 760px;
    padding: 38px;
    margin: 20px auto;
    background: rgba(17, 26, 43, 0.88);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    animation: cardEntry 0.6s ease both;
}

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

/* Heading */

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 700;
    letter-spacing: -1.2px;
    color: #fff;
}

.title-small {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--accent);
    background: rgba(245, 158, 11, 0.12);
    padding: 5px 10px;
    border-radius: 20px;
    vertical-align: middle;
}

.required-note {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

.required-mark {
    color: var(--accent);
    font-weight: 700;
}

/* Form grid */

.form-container {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 23px 20px;
}

.form-control,
.textarea_control {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.textarea_control {
    grid-column: 1 / -1;
}

/* Labels */

label {
    margin-bottom: 9px;
    font-size: 13px;
    font-weight: 600;
    color: #dbe4f0;
}

/* Inputs */

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    transition: border-color 0.25s ease,
                box-shadow 0.25s ease,
                background 0.25s ease;
}

input::placeholder,
textarea::placeholder {
    color: #64748b;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(245, 158, 11, 0.4);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    background: #1a2940;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

textarea {
    resize: vertical;
    min-height: 110px;
}

/* Select */

select {
    cursor: pointer;
    color-scheme: dark;
}

select option {
    background: var(--surface);
    color: var(--text);
}

/* Date input */

input[type="date"] {
    color-scheme: dark;
    cursor: pointer;
}

/* File upload */

input[type="file"] {
    padding: 9px;
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
}

input[type="file"]::file-selector-button {
    padding: 8px 12px;
    margin-right: 12px;
    border: none;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
    background: rgba(245, 158, 11, 0.25);
}

/* Hints */

.hint {
    margin-top: 7px;
    font-size: 12px;
    color: var(--muted);
}

/* Submit button */

.button-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 23px;
    border-top: 1px solid var(--border);
}

button {
    padding: 12px 30px;
    border: 1px solid var(--accent);
    border-radius: 9px;
    background: var(--accent);
    color: #111827;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.2);
}

button:active {
    transform: translateY(0);
}

/* Validation */

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.error-message {
    margin-top: 7px;
    font-size: 12px;
    font-weight: 600;
    color: var(--danger);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.08);
}

.error-summary {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid rgba(251, 113, 133, 0.4);
    border-radius: 10px;
    background: rgba(251, 113, 133, 0.08);
}

.error-summary h2 {
    font-size: 15px;
    color: var(--danger);
}

.error-summary ul {
    margin: 10px 0 0 20px;
}

.error-summary li {
    margin-top: 5px;
    font-size: 13px;
    color: #fda4af;
}

.error-summary a {
    color: #fda4af;
}

.form-status {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(74, 222, 128, 0.08);
    color: var(--success);
    font-size: 14px;
    font-weight: 600;
}

.form-status:empty {
    display: none;
}

/* Accessibility */

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
.error-summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Responsive */

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        min-height: auto;
    }

    .apply-box {
        padding: 25px 20px;
        margin: 15px auto;
        border-radius: 16px;
    }

    .form-container {
        grid-template-columns: 1fr;
        gap: 19px;
        margin-top: 25px;
    }

    .textarea_control {
        grid-column: auto;
    }

    .button-container {
        margin-top: 24px;
    }

    button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


/* Success Toast */

.toast-notification {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 9999;

    width: min(380px, calc(100vw - 30px));
    padding: 18px;

    display: flex;
    align-items: center;
    gap: 14px;

    background: rgba(17, 26, 43, 0.96);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 14px;

    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);

    opacity: 0;
    visibility: hidden;
    transform: translateX(30px);

    transition: all 0.35s ease;
    overflow: hidden;
}

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

.toast-icon {
    min-width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 50%;
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;

    font-size: 21px;
    font-weight: 700;
}

.toast-content {
    flex: 1;
}

.toast-content h3 {
    font-size: 14px;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.toast-content p {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}

.toast-close {
    padding: 0;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 23px;
    cursor: pointer;
}

.toast-close:hover {
    color: white;
    background: transparent;
    box-shadow: none;
    transform: none;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #4ade80;
    transform-origin: left;
}

.toast-notification.show .toast-progress {
    animation: toastTimer 4s linear forwards;
}

@keyframes toastTimer {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@media (max-width: 480px) {
    .toast-notification {
        top: 15px;
        right: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast-notification {
        transition: none;
    }

    .toast-notification.show .toast-progress {
        animation: none;
    }
}
