/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    --primary:       #0f5c6b;
    --primary-dark:  #093f4b;
    --primary-mid:   #137080;
    --primary-light: #e3f4f7;
    --accent:        #c0782a;
    --accent-dark:   #9a5e1e;
    --surface:       #ffffff;
    --bg:            #f3f7f8;
    --border:        #dde8ea;
    --text:          #1a2428;
    --muted:         #607880;
    --danger:        #d93636;
    --shadow-sm:     0 2px 8px rgba(15,92,107,0.07);
    --shadow-md:     0 8px 32px rgba(15,92,107,0.10);
    --shadow-lg:     0 20px 56px rgba(15,92,107,0.14);
    --radius-sm:     8px;
    --radius-md:     14px;
    --radius-lg:     22px;
    --transition:    all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & GLOBAL ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    margin: 0;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ===== PAGE WRAP ===== */
.page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background:
        radial-gradient(ellipse 55% 45% at 15% 0%,   rgba(15,92,107,0.09) 0%, transparent 70%),
        radial-gradient(ellipse 45% 40% at 85% 100%, rgba(192,120,42,0.07) 0%, transparent 70%),
        #f3f7f8;
}

/* ===== CARD ===== */
.form-card {
    width: 100%;
    max-width: 860px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.9);
    animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(28px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ===== HEADER ===== */
.form-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* Decorative geometry */
.form-header::before {
    content: '';
    position: absolute;
    top: -44px; right: -44px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.form-header::after {
    content: '';
    position: absolute;
    bottom: -65px; left: 28%;
    width: 280px; height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}

/* Gold accent stripe top */
.form-header-stripe {
    height: 4px;
    background: linear-gradient(90deg, var(--accent), rgba(192,120,42,0.2), transparent);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 32px 20px;
    position: relative;
    z-index: 1;
}

.logo-ring {
    flex-shrink: 0;
    width: 72px; height: 72px;
    background: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.20);
    border: 3px solid rgba(255,255,255,0.5);
}

.logo-ring img {
    width: 52px; height: 52px;
    object-fit: contain;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 21px;
    line-height: 1.25;
    letter-spacing: 0.01em;
    color: #fff;
}

/* Cell name — gold tint to distinguish from institute name */
.campus {
    font-weight: 600;
    font-size: 13px;
    color: #f5c97a;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.campus::before {
    content: '';
    display: inline-block;
    width: 18px; height: 2px;
    background: #f5c97a;
    border-radius: 2px;
    flex-shrink: 0;
}

.header-divider {
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.30), rgba(255,255,255,0.04) 60%, transparent);
}

/* ===== FORM BODY ===== */
.form-body {
    padding: 36px 36px 28px;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius-md);
    font-size: 14px;
    padding: 14px 18px;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-weight: 500;
}
.alert-success { background: #edfbf4; color: #0b7d59; }
.alert-error,
.alert-danger   { background: #fff5f5; color: #c53030; }
.alert-info     { background: var(--primary-light); color: var(--primary-dark); }
.alert-warning  { background: #fffbea; color: #92640a; }

/* ===== SECTION TITLE ===== */
.section-title {
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}
.section-title i { font-size: 15px; }

/* ===== FIELD GROUPS ===== */
.field-group {
    position: relative;
    margin-bottom: 0;
}

/* ===== LABEL ===== */
.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px;
    display: block;
    letter-spacing: 0.02em;
}

/* ===== INPUT WRAP ===== */
.input-icon-wrap {
    position: relative;
}

.field-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s;
}

/* ===== INPUTS ===== */
.form-control {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm) !important;
    background: #f7fafb;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    color: var(--text);
    padding: 0 16px;
    transition: var(--transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-control:hover {
    border-color: #9fc8d0;
    background: #fff;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3.5px rgba(15,92,107,0.13);
    background: #fff;
}

/* Icon offset */
.input-icon-wrap .form-control {
    padding-left: 44px;
}

/* No-icon fields */
.input-icon-wrap select.form-control,
.input-icon-wrap input[type="email"].form-control {
    padding-left: 16px;
}

/* Select arrow */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' fill='%23607880' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 13px;
    padding-right: 40px;
    cursor: pointer;
}

/* ===== ERRORS ===== */
.field-error {
    color: var(--danger);
    font-size: 12.5px;
    margin-top: 5px;
    font-weight: 500;
}
.field-error::before {
    content: '⚠ ';
    font-size: 11px;
}

/* ===== SUBMIT BUTTON — gold/amber for ethics cell ===== */
.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: none;
    padding: 15px 24px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    border-radius: var(--radius-md);
    cursor: pointer;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 18px rgba(192,120,42,0.26);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(192,120,42,0.34);
}
.btn-submit:hover::before { opacity: 1; }

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(192,120,42,0.20);
}

.btn-submit:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== SPINNER ===== */
.btn-spinner {
    display: none;
    width: 17px; height: 17px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    flex-shrink: 0;
}

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

/* ===== FOOTER ===== */
.form-footer {
    padding: 14px 32px;
    background: #f4f8f9;
    border-top: 1px solid var(--border);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
}

.footer-brand a {
    text-decoration: none;
    font-weight: 600;
    color: var(--primary);
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.footer-brand a::before {
    content: '\F30A';
    font-family: 'bootstrap-icons';
    font-size: 14px;
}
.footer-brand a:hover { color: var(--primary-dark); text-decoration: underline; }

.footer-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== ROW SPACING ===== */
.row.g-3 { row-gap: 20px !important; }
.mt-4    { margin-top: 28px !important; }

/* ===== RESPONSIVE — TABLET ===== */
@media (max-width: 768px) {
    .page-wrap { padding: 16px 12px; }

    .form-card { border-radius: var(--radius-md); }

    .header-inner {
        flex-direction: column;
        text-align: center;
        padding: 22px 20px 18px;
        gap: 14px;
    }

    .campus { justify-content: center; }
    .campus::before { display: none; }

    .logo-ring { width: 62px; height: 62px; }
    .logo-ring img { width: 44px; height: 44px; }

    .brand  { font-size: 17px; }
    .campus { font-size: 11.5px; }

    .form-body { padding: 24px 20px 20px; }

    .form-footer { padding: 12px 20px; }
}

/* ===== RESPONSIVE — MOBILE ===== */
@media (max-width: 480px) {
    .page-wrap {
        padding: 0;
        align-items: flex-start;
        background: #fff;
    }

    .form-card {
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
        border: none;
    }

    .brand { font-size: 15px; }

    .form-body { padding: 20px 16px; }

    .form-control { height: 46px; font-size: 14.5px; }

    .btn-submit { font-size: 15px; padding: 14px; }

    .section-title { font-size: 11px; }

    .form-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 16px;
    }
}