* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(40, 86, 160, 0.18), transparent 30%),
        radial-gradient(circle at bottom left, rgba(30, 160, 120, 0.15), transparent 28%),
        linear-gradient(135deg, #f3f7fc 0%, #eef4fb 45%, #f8fbff 100%);
    color: #16324f;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 24px;
}

.hero {
    background: linear-gradient(135deg, #0f3b75 0%, #1f5fa8 55%, #3d84d8 100%);
    color: #fff;
    border-radius: 28px;
    padding: 34px 28px;
    box-shadow: 0 18px 40px rgba(15, 59, 117, 0.22);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: auto auto -60px -60px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.hero::after {
    content: "";
    position: absolute;
    inset: -55px -45px auto auto;
    width: 170px;
    height: 170px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 50%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 14px;
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
}

.hero-title {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.3;
    font-weight: 700;
}

.hero-subtitle {
    margin: 0;
    max-width: 780px;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.92);
    font-size: 16px;
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-top: 26px;
    position: relative;
    z-index: 1;
}

.meta-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    padding: 16px 18px;
    backdrop-filter: blur(10px);
}

.meta-label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.82);
}

.main-grid {
    display: grid;
    grid-template-columns: 1.55fr 0.95fr;
    gap: 24px;
    margin-top: 24px;
}

.cards-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.portal-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(21, 61, 109, 0.08);
    border-radius: 24px;
    padding: 22px 20px;
    box-shadow: 0 14px 28px rgba(16, 54, 96, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.portal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 34px rgba(16, 54, 96, 0.12);
}

.school-card:hover {
    border-color: rgba(38, 94, 175, 0.28);
}

.institution-card:hover {
    border-color: rgba(19, 138, 111, 0.28);
}

.admin-card:hover {
    border-color: rgba(153, 94, 24, 0.28);
}

.card-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 28px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ecf4ff 0%, #dbeaff 100%);
}

.institution-card .card-icon {
    background: linear-gradient(135deg, #e8fff7 0%, #d1f6e9 100%);
}

.admin-card .card-icon {
    background: linear-gradient(135deg, #fff6e8 0%, #ffe9c8 100%);
}

.portal-card h2 {
    margin: 0 0 12px;
    font-size: 22px;
    color: #14385c;
}

.portal-card p {
    margin: 0 0 18px;
    line-height: 1.9;
    color: #47627f;
    font-size: 15px;
    flex-grow: 1;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 14px;
    padding: 0 18px;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    background: linear-gradient(135deg, #19539c 0%, #2a75d0 100%);
}

.institution-card .card-btn {
    background: linear-gradient(135deg, #0c8d6a 0%, #20ae88 100%);
}

.admin-card .card-btn {
    background: linear-gradient(135deg, #b17415 0%, #d89426 100%);
}

.info-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.info-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    padding: 22px 20px;
    box-shadow: 0 14px 28px rgba(16, 54, 96, 0.08);
    border: 1px solid rgba(21, 61, 109, 0.07);
}

.info-box.accent {
    background: linear-gradient(135deg, rgba(19, 95, 180, 0.96) 0%, rgba(31, 132, 192, 0.94) 100%);
    color: #fff;
}

.info-box h3 {
    margin: 0 0 14px;
    font-size: 20px;
}

.info-box ul {
    margin: 0;
    padding: 0 18px 0 0;
    line-height: 2;
}

.info-box li {
    margin-bottom: 6px;
}

.info-box.accent li,
.info-box.accent h3 {
    color: #fff;
}

.site-footer {
    text-align: center;
    padding: 16px 10px 4px;
    color: #5b6f86;
    font-size: 14px;
}

.form-page {
    width: min(1000px, calc(100% - 26px));
    margin: 0 auto;
    padding: 24px 0 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.topbar .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #14416d;
    border: 1px solid rgba(21, 61, 109, 0.08);
    border-radius: 14px;
    padding: 10px 16px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(16, 54, 96, 0.07);
}

.page-title-box {
    background: linear-gradient(135deg, #0f3b75 0%, #2b72c9 100%);
    color: #fff;
    border-radius: 24px;
    padding: 24px 22px;
    box-shadow: 0 18px 34px rgba(15, 59, 117, 0.18);
    margin-bottom: 20px;
}

.page-title-box h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.page-title-box p {
    margin: 0;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.92);
}

.form-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 24px;
    padding: 24px 22px;
    box-shadow: 0 14px 28px rgba(16, 54, 96, 0.08);
    border: 1px solid rgba(21, 61, 109, 0.07);
}

.form-section {
    margin-bottom: 26px;
}

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

.section-title {
    margin: 0 0 16px;
    color: #15395e;
    font-size: 20px;
    border-right: 4px solid #2a75d0;
    padding-right: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 700;
    color: #21456b;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d7e2ef;
    background: #fff;
    border-radius: 14px;
    min-height: 48px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    color: #173451;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3a82da;
    box-shadow: 0 0 0 4px rgba(58, 130, 218, 0.12);
}

.note-text {
    font-size: 13px;
    color: #6a7f95;
    margin-top: -2px;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 14px;
    background: #f7fbff;
    border: 1px solid #dbe8f6;
    cursor: pointer;
}

.radio-option input {
    width: auto;
    min-height: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.btn {
    border: 0;
    border-radius: 14px;
    min-height: 48px;
    padding: 0 20px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #16519a 0%, #2a75d0 100%);
    color: #fff;
}

.btn-secondary {
    background: #eef5fc;
    color: #19436b;
    border: 1px solid #d7e3ef;
}

.alert {
    padding: 15px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.8;
}

.alert-success {
    background: #ecfbf4;
    border: 1px solid #b9ead0;
    color: #0f6a45;
}

.alert-error {
    background: #fff0f0;
    border: 1px solid #f1c0c0;
    color: #a23f3f;
}

.hidden {
    display: none !important;
}

@media (max-width: 980px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .info-panel {
        order: 2;
    }

    .cards-section {
        order: 1;
    }
}

@media (max-width: 768px) {
    .page-shell {
        width: min(100% - 20px, 100%);
        padding-top: 18px;
    }

    .hero {
        padding: 24px 18px;
        border-radius: 22px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .form-page {
        width: min(100% - 16px, 100%);
        padding-top: 16px;
    }

    .page-title-box,
    .form-card {
        padding: 20px 16px;
        border-radius: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .portal-card {
        min-height: auto;
    }

    .card-btn {
        width: 100%;
    }
}
