/* ==============================
   Student Admission – Frontend CSS
   ============================== */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --sf-navy:    #0f172a;
    --sf-indigo:  #4338ca;
    --sf-violet:  #7c3aed;
    --sf-amber:   #f59e0b;
    --sf-green:   #10b981;
    --sf-bg:      #f1f5f9;
    --sf-white:   #ffffff;
    --sf-border:  #cbd5e1;
    --sf-muted:   #64748b;
    --sf-radius:  14px;
    --sf-shadow:  0 4px 24px rgba(67,56,202,.08);
}

.sam-frontend-wrap {
    font-family: 'DM Sans', sans-serif;
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 20px;
    color: var(--sf-navy);
}

/* Header */
.sam-form-header {
    text-align: center;
    padding: 40px 24px 32px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4c1d95 100%);
    border-radius: var(--sf-radius);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}
.sam-form-header::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='20' cy='20' r='1' fill='%23ffffff' fill-opacity='0.06'/%3E%3C/svg%3E") repeat;
}
.sam-form-header h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 32px; font-weight: 400;
    color: #fff; margin: 0 0 10px;
    position: relative;
}
.sam-form-header p {
    color: rgba(255,255,255,.7); font-size: 15px; margin: 0;
    position: relative;
}
.sam-req { color: var(--sf-amber); font-weight: 700; }

/* Form */
.sam-reg-form { display: flex; flex-direction: column; gap: 24px; }

/* Fieldset */
.sam-fieldset {
    border: none; padding: 0; margin: 0;
    background: var(--sf-white);
    border-radius: var(--sf-radius);
    box-shadow: var(--sf-shadow);
    overflow: hidden;
}
.sam-fieldset legend {
    width: 100%;
    display: block;
    padding: 16px 24px;
    font-size: 15px; font-weight: 700;
    background: linear-gradient(90deg, #eef2ff, #f5f3ff);
    border-bottom: 2px solid #e0e7ff;
    color: var(--sf-indigo);
    letter-spacing: .3px;
}
.sam-fieldset > * { padding: 0 24px; }
.sam-fieldset legend { padding-left: 24px; }
.sam-fieldset > .sam-row:first-of-type { padding-top: 20px; }
.sam-fieldset > .sam-row:last-of-type { padding-bottom: 24px; }

/* Grid rows */
.sam-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.sam-col { display: flex; flex-direction: column; gap: 6px; }
.sam-col-full { grid-column: 1 / -1; }
.sam-col-auto { flex: 0 0 auto; }

/* Labels & inputs */
.sam-col label {
    font-size: 12.5px; font-weight: 600; color: var(--sf-muted);
    text-transform: uppercase; letter-spacing: .5px;
}
.sam-col input,
.sam-col select,
.sam-col textarea {
    padding: 10px 14px;
    border: 1.5px solid var(--sf-border);
    border-radius: 10px;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    color: var(--sf-navy);
    background: #fafbff;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    box-sizing: border-box;
}
.sam-col input:focus,
.sam-col select:focus,
.sam-col textarea:focus {
    border-color: var(--sf-indigo);
    box-shadow: 0 0 0 3px rgba(67,56,202,.12);
    outline: none;
    background: #fff;
}
.sam-col input::placeholder,
.sam-col textarea::placeholder { color: #b0bec5; }
.sam-col textarea { resize: vertical; min-height: 80px; }
.sam-col select { cursor: pointer; }

/* Hint */
.sam-hint { color: var(--sf-muted); font-size: 13px; padding: 10px 0 0; }

/* Sibling rows */
#sam-siblings-container { padding-bottom: 4px; }
.sam-sibling-entry { margin-bottom: 0; }
.sam-icon-btn {
    width: 38px; height: 38px;
    border: none; border-radius: 8px;
    background: #fee2e2; color: #dc2626;
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    margin-top: 24px;
    transition: background .15s;
}
.sam-icon-btn:hover { background: #fecaca; }
.sam-add-btn {
    display: inline-flex; align-items: center; gap: 6px;
    margin: 8px 0 20px;
    padding: 9px 18px;
    border: 1.5px dashed var(--sf-indigo);
    border-radius: 10px;
    background: transparent; color: var(--sf-indigo);
    font-size: 14px; font-weight: 600; cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background .15s;
}
.sam-add-btn:hover { background: #eef2ff; }

/* Submit */
.sam-submit-row { text-align: center; padding: 8px 0; }
.sam-submit-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 40px;
    background: linear-gradient(135deg, #4338ca 0%, #7c3aed 100%);
    color: #fff; border: none; border-radius: 12px;
    font-size: 17px; font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(124,58,237,.35);
    transition: transform .15s, box-shadow .15s;
}
.sam-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(124,58,237,.45);
}
.sam-submit-btn:active { transform: translateY(0); }

/* Success card */
.sam-success-card {
    text-align: center;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #6ee7b7;
    border-radius: var(--sf-radius);
    padding: 60px 40px;
}
.sam-success-icon { font-size: 60px; margin-bottom: 16px; }
.sam-success-card h2 { font-family: 'DM Serif Display', serif; font-size: 28px; color: #065f46; margin: 0 0 12px; }
.sam-success-card p { color: #047857; font-size: 16px; margin: 0; }

/* Responsive */
@media (max-width: 580px) {
    .sam-row { grid-template-columns: 1fr; }
    .sam-form-header h2 { font-size: 24px; }
    .sam-submit-btn { width: 100%; justify-content: center; }
}

/* ============================================================
   FORM VALIDATION STYLES
============================================================ */
.sam-invalid {
    border-color: #e53935 !important;
    background-color: #fff8f8 !important;
    box-shadow: 0 0 0 3px rgba(229,57,53,.15) !important;
}

.sam-field-error {
    display: block;
    color: #e53935;
    font-size: 0.78rem;
    margin-top: 4px;
    font-weight: 500;
    line-height: 1.4;
}

.sam-field-error::before {
    content: "⚠ ";
}

.sam-validation-summary {
    background: #fff3f3;
    border: 1.5px solid #e53935;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #c62828;
    font-size: 0.92rem;
}

/* ============================================================
   DOWNLOAD APPLICATION BUTTON
============================================================ */
.sam-download-wrap {
    margin-top: 24px;
    text-align: center;
}

.sam-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .1s;
    box-shadow: 0 2px 8px rgba(21,101,192,.25);
}

.sam-download-btn:hover {
    background: #0d47a1;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.sam-download-btn:disabled {
    background: #90a4ae;
    cursor: not-allowed;
    transform: none;
}

.sam-download-btn svg {
    flex-shrink: 0;
}
