/* ==========================================================
   ADITYA UNIVERSITY - APPLICATION FORM
   Optimized responsive stylesheet
========================================================== */

/* ==========================================================
   VARIABLES
========================================================== */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;

    --secondary: #0f172a;

    --success: #16a34a;
    --success-bg: #dcfce7;

    --danger: #dc2626;
    --danger-bg: #fee2e2;

    --surface: #ffffff;
    --background: #f8fafc;

    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;

    --border: #dbe3ee;
    --border-hover: #94a3b8;
    --border-error: #ef4444;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow:
        0 10px 30px rgba(15, 23, 42, 0.08);

    --shadow-button:
        0 15px 30px rgba(37, 99, 235, 0.25);

    --transition: 0.2s ease;
}


/* ==========================================================
   RESET
========================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* ==========================================================
   HTML
========================================================== */

html {
    scroll-behavior: smooth;
}


/* ==========================================================
   BODY
========================================================== */

body {
    min-height: 100vh;

    font-family:
        "Inter",
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    line-height: 1.6;

    color: var(--text);

    background:
        linear-gradient(
            180deg,
            #eef4ff 0%,
            #f8fafc 100%
        );

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


/* ==========================================================
   IMAGES
========================================================== */

img {
    max-width: 100%;
    height: auto;
}


/* ==========================================================
   UNIVERSITY LOGO
========================================================== */

.university-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    margin-bottom: 20px;
}

.university-logo img {
    display: block;

    width: 100%;
    max-width: 500px;
    max-height: 90px;

    object-fit: contain;
}


/* ==========================================================
   MAIN CONTAINER
========================================================== */

.container {
    width: min(1000px, calc(100% - 32px));

    margin: 40px auto;
    padding: 45px;

    background: var(--surface);

    border: 1px solid rgba(219, 227, 238, 0.7);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow);

    animation: fade-in 0.35s ease both;
}


/* ==========================================================
   ANIMATION
========================================================== */

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================================
   HEADINGS
========================================================== */

h1,
h2 {
    color: var(--secondary);
}

h1 {
    margin-bottom: 12px;

    text-align: center;

    font-size: clamp(24px, 4vw, 34px);
    font-weight: 700;
    line-height: 1.3;
}

h2 {
    margin: 45px 0 25px;
    padding-bottom: 12px;

    border-bottom: 1px solid #e5e7eb;

    font-size: 23px;
    font-weight: 700;
    line-height: 1.3;
}


/* ==========================================================
   INTRO
========================================================== */

.intro {
    max-width: 720px;

    margin: 0 auto 40px;

    text-align: center;

    color: var(--text-light);

    font-size: 15px;
}


/* ==========================================================
   HORIZONTAL RULE
========================================================== */

hr {
    margin: 0 0 20px;

    border: 0;
    border-top: 1px solid #e5e7eb;
}


/* ==========================================================
   GRID
========================================================== */

.grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );

    gap: 24px;
}

.full {
    grid-column: 1 / -1;
}


/* ==========================================================
   FORM GROUP
========================================================== */

.form-group {
    display: flex;
    flex-direction: column;

    min-width: 0;
}


/* ==========================================================
   LABEL
========================================================== */

label {
    margin-bottom: 8px;

    color: #334155;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;

    cursor: pointer;
}


/* ==========================================================
   FORM CONTROLS
========================================================== */

input,
select,
textarea {
    width: 100%;

    min-height: 48px;

    padding: 13px 16px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);
    color: var(--text);

    font: inherit;
    font-size: 15px;
    line-height: 1.4;

    outline: none;

    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background-color var(--transition);
}


/* ==========================================================
   HOVER
========================================================== */

input:not(:disabled):hover,
select:not(:disabled):hover,
textarea:not(:disabled):hover {
    border-color: var(--border-hover);
}


/* ==========================================================
   FOCUS
========================================================== */

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px
        rgba(37, 99, 235, 0.14);
}


/* ==========================================================
   ACCESSIBLE KEYBOARD FOCUS
========================================================== */

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 2px;
}


/* ==========================================================
   INVALID FIELDS
   Red only after user interaction
========================================================== */

input:user-invalid,
select:user-invalid,
textarea:user-invalid {
    border-color: var(--border-error);
}


/* ==========================================================
   INVALID + FOCUS
========================================================== */

input:user-invalid:focus,
select:user-invalid:focus,
textarea:user-invalid:focus {
    border-color: var(--border-error);

    box-shadow:
        0 0 0 4px
        rgba(239, 68, 68, 0.12);
}


/* ==========================================================
   DISABLED
========================================================== */

input:disabled,
select:disabled,
textarea:disabled {
    background: #f8fafc;

    color: #94a3b8;

    cursor: not-allowed;

    opacity: 0.7;
}


/* ==========================================================
   TEXTAREA
========================================================== */

textarea {
    min-height: 130px;

    resize: vertical;
}


/* ==========================================================
   SELECT
========================================================== */

select {
    cursor: pointer;
}


/* ==========================================================
   PLACEHOLDER
========================================================== */

::placeholder {
    color: var(--text-muted);
    opacity: 1;
}


/* ==========================================================
   HIDDEN
========================================================== */

.hidden {
    display: none !important;
}


/* ==========================================================
   SHOW ANIMATION
========================================================== */

.form-group.show {
    display: flex;

    animation:
        fade-in 0.25s ease both;
}


/* ==========================================================
   FILE INPUT
========================================================== */

input[type="file"] {
    min-height: 48px;

    padding: 8px;

    background: var(--surface);

    cursor: pointer;
}


/* ==========================================================
   FILE INPUT HOVER
========================================================== */

input[type="file"]:hover {
    background: #f8fbff;
}


/* ==========================================================
   FILE SELECTOR BUTTON
========================================================== */

input[type="file"]::file-selector-button {
    margin-right: 12px;

    padding: 9px 14px;

    border: 0;
    border-radius: var(--radius-sm);

    background: var(--primary);
    color: #fff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color var(--transition),
        transform var(--transition);
}


/* ==========================================================
   FILE BUTTON HOVER
========================================================== */

input[type="file"]::file-selector-button:hover {
    background: var(--primary-hover);
}


/* ==========================================================
   FILE BUTTON ACTIVE
========================================================== */

input[type="file"]::file-selector-button:active {
    transform: scale(0.97);
}


/* ==========================================================
   HELP TEXT
========================================================== */

small,
.file-info {
    display: block;

    margin-top: 7px;

    color: var(--text-light);

    font-size: 13px;
    line-height: 1.45;
}


/* ==========================================================
   BUTTON
========================================================== */

button {
    width: 100%;

    margin-top: 40px;

    padding: 15px 18px;

    border: 0;
    border-radius: var(--radius-md);

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #3b82f6
        );

    color: #fff;

    font: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;

    cursor: pointer;

    box-shadow:
        0 6px 15px
        rgba(37, 99, 235, 0.15);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}


/* ==========================================================
   BUTTON HOVER
========================================================== */

button:hover:not(:disabled) {
    transform: translateY(-2px);

    box-shadow: var(--shadow-button);

    background:
        linear-gradient(
            135deg,
            var(--primary-hover),
            var(--primary)
        );
}


/* ==========================================================
   BUTTON ACTIVE
========================================================== */

button:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}


/* ==========================================================
   BUTTON DISABLED
========================================================== */

button:disabled {
    background: #94a3b8;

    color: #e2e8f0;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;
}


/* ==========================================================
   ALERTS
========================================================== */

.success,
.error {
    margin-bottom: 25px;

    padding: 16px 20px;

    border-radius: var(--radius-md);

    font-weight: 600;
    line-height: 1.5;
}


/* ==========================================================
   SUCCESS
========================================================== */

.success {
    background: var(--success-bg);
    color: #166534;

    border-left:
        5px solid
        var(--success);
}


/* ==========================================================
   ERROR
========================================================== */

.error {
    background: var(--danger-bg);
    color: #991b1b;

    border-left:
        5px solid
        var(--danger);
}


/* ==========================================================
   SCROLLBAR
========================================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #eef2f7;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 900px) {

    .container {
        width: min(95%, 1000px);

        padding: 30px;
    }

    .university-logo img {
        max-width: 450px;
        max-height: 80px;
    }

    h2 {
        margin-top: 35px;
    }
}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 768px) {

    body {
        padding: 10px;
    }

    .container {
        width: 100%;

        margin: 20px auto;

        padding: 28px 24px;

        border-radius: 14px;
    }

    .university-logo {
        margin-bottom: 18px;
    }

    .university-logo img {
        max-width: 350px;
        max-height: 70px;
    }

    .grid {
        grid-template-columns: 1fr;

        gap: 20px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        margin-top: 35px;

        font-size: 20px;
    }

    .intro {
        margin-bottom: 30px;

        font-size: 14px;
    }

    button {
        margin-top: 30px;
    }
}


/* ==========================================================
   SMALL MOBILE
========================================================== */

@media (max-width: 480px) {

    body {
        padding: 6px;
    }

    .container {
        margin: 10px auto;

        padding: 22px 18px;

        border-radius: 12px;
    }

    .university-logo {
        margin-bottom: 15px;
    }

    .university-logo img {
        max-width: 280px;
        max-height: 60px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        margin-top: 30px;

        font-size: 19px;
    }

    .intro {
        font-size: 14px;
    }

    label {
        font-size: 13px;
    }

    input,
    select,
    textarea {
        min-height: 46px;

        padding: 12px 14px;

        font-size: 14px;
    }

    input[type="file"] {
        padding: 7px;
    }

    input[type="file"]::file-selector-button {
        margin-right: 8px;

        padding: 7px 10px;

        font-size: 13px;
    }

    small,
    .file-info {
        font-size: 12px;
    }

    button {
        margin-top: 25px;

        padding: 14px;

        font-size: 16px;
    }
}


/* ==========================================================
   VERY SMALL SCREENS
========================================================== */

@media (max-width: 360px) {

    .container {
        padding: 18px 14px;
    }

    .university-logo img {
        max-width: 250px;
        max-height: 55px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
    }
}


/* ==========================================================
   REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}