* {
    box-sizing: border-box
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-semibold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-extrabold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

html,
body {
    min-height: 100%;
    margin: 0
}

body {
    font-family: 'Inter', Arial, sans-serif;
    color: #0f2b57;
    background: #eef7ff;
    overflow-x: hidden
}

.portal-page {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 18px
}

.portal-bg-layer {
    position: fixed;
    inset: 0;
    background-image: url('../images/portal-bg.png');
    background-size: cover;
    background-position: center;
    z-index: 0
}

.portal-dark-layer {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, .40), rgba(238, 247, 255, .18));
    z-index: 1
}

.portal-glow {
    display: none
}

.portal-shell {
    position: relative;
    z-index: 3;
    width: min(940px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 42px 44px 34px;
    border-radius: 28px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(122, 172, 226, .34);
    box-shadow: 0 28px 80px rgba(47, 102, 169, .18), 0 0 0 8px rgba(255, 255, 255, .38);
    overflow: hidden
}

.portal-shell:before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 28px;
    padding: 6px;
    background: linear-gradient(135deg, #91d8ff, #bc9cff, #ffd780);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none
}

.portal-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1
}

.portal-logo-link {
    display: inline-flex
}

.portal-logo {
    width: 154px;
    height: 154px;
    object-fit: contain;
    margin-bottom: 18px;
    filter: drop-shadow(0 14px 24px rgba(38, 96, 160, .18))
}

.portal-header h1 {
    font-size: 35px;
    line-height: 1.15;
    margin: 0 0 8px;
    font-weight: 800;
    letter-spacing: -.035em;
    color: #000000
}

.portal-header h1 strong {
    color: #1765d4;
}

.portal-header h1::first-letter {
    color: #0b2d63
}

.portal-header p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #425575
}

.captcha-card {
    width: min(690px, 100%);
    min-height: 96px;
    border: 1px solid rgba(207, 218, 234, .9);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 16px 38px rgba(36, 87, 153, .12);
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 16px 20px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1
}

.captcha-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: linear-gradient(135deg, #eff6ff, #ddecff);
    box-shadow: 0 0 0 10px rgba(37, 123, 236, .08)
}

.captcha-icon i {
    font-size: 30px;
    color: #156ee8
}

.captcha-content {
    width: 100%
}

.captcha-loading {
    margin: 0;
    color: #20365f;
    font-weight: 700
}

.captcha-question-wrap {
    display: flex;
    align-items: center;
    gap: 22px;
    width: 100%
}

.captcha-question {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: .02em;
    color: #102a5c;
    white-space: nowrap
}

.captcha-input {
    height: 56px;
    width: 190px;
    border-radius: 11px;
    border: 1px solid #cdd8e8;
    background: #fff;
    color: #24375b;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    padding: 0 16px;
    transition: .2s
}

.captcha-input::placeholder {
    color: #7e8ba0
}

.captcha-input:focus {
    border-color: #679cf6;
    box-shadow: 0 0 0 4px rgba(103, 156, 246, .14)
}

.captcha-submit {
    height: 56px;
    width: 62px;
    border: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 22px;
    background: linear-gradient(135deg, #42a5ff, #7b57ff);
    box-shadow: 0 14px 28px rgba(82, 125, 245, .25);
    transition: .2s
}

.captcha-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(82, 125, 245, .32)
}

.captcha-message {
    min-height: 22px;
    margin: -6px 0 12px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    position: relative;
    z-index: 1
}

.captcha-message.error {
    color: #df3d3d
}

.captcha-message.success {
    color: #0b9b5a
}

.portal-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    position: relative;
    z-index: 1
}

.action-card {
    position: relative;
    min-height: 96px;
    text-decoration: none !important;
    border-radius: 16px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 12px 28px rgba(37, 86, 148, .08);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 17px 18px;
    grid-column: span 2;
    color: #102a5c;
    overflow: hidden;
    transition: .22s;
    border: 1px solid transparent
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(37, 86, 148, .14)
}

.action-wide {
    grid-column: span 3
}

.action-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 24px;
    position: relative;
    z-index: 1
}

.action-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    position: relative;
    z-index: 1
}

.action-text strong {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.01em
}

.action-text small {
    font-size: 15px;
    font-weight: 500;
    color: #344765
}

.action-arrow {
    margin-left: auto;
    position: relative;
    z-index: 1;
    font-size: 20px
}

.action-registration {
    border-color: #b8e7d0;
    background: linear-gradient(135deg, #f1fff8, #ffffff)
}

.action-registration .action-icon {
    background: #d9f8e7;
    color: #079a58
}

.action-registration .action-text strong,
.action-registration .action-arrow {
    color: #048c4f
}

.action-registration-blue {
    border-color: #bad7ff;
    background: linear-gradient(135deg, #f2f8ff, #ffffff)
}

.action-registration-blue .action-icon {
    background: #dceaff;
    color: #156ee8
}

.action-registration-blue .action-text strong,
.action-registration-blue .action-arrow {
    color: #1068df
}

.action-student {
    border-color: #dccaff;
    background: linear-gradient(135deg, #faf6ff, #ffffff)
}

.action-student .action-icon {
    background: #eee4ff;
    color: #7147da
}

.action-student .action-text strong,
.action-student .action-arrow {
    color: #7147da
}

.action-teacher {
    border-color: #ffd6ba;
    background: linear-gradient(135deg, #fff8f2, #ffffff)
}

.action-teacher .action-icon {
    background: #ffe9d6;
    color: #df5a00
}

.action-teacher .action-text strong,
.action-teacher .action-arrow {
    color: #df5a00
}

.action-admin {
    border-color: #ffcbd3;
    background: linear-gradient(135deg, #fff5f7, #ffffff)
}

.action-admin .action-icon {
    background: #ffe2e7;
    color: #df2943
}

.action-admin .action-text strong,
.action-admin .action-arrow {
    color: #df2943
}

.action-library {
    border-color: #cfc5ff;
    background: linear-gradient(135deg, #f8f5ff, #fff)
}

.action-library .action-icon {
    background: #eee8ff;
    color: #6543d9
}

.action-library .action-text strong,
.action-library .action-arrow {
    color: #6543d9
}

.action-accounting {
    border-color: #b7ece8;
    background: linear-gradient(135deg, #f1fffd, #fff)
}

.action-accounting .action-icon {
    background: #dcfbf8;
    color: #069b94
}

.action-accounting .action-text strong,
.action-accounting .action-arrow {
    color: #069b94
}

.action-camp {
    border-color: #ffe5a6;
    background: linear-gradient(135deg, #fffaf0, #fff)
}

.action-camp .action-icon {
    background: #fff1c9;
    color: #c97900
}

.action-camp .action-text strong,
.action-camp .action-arrow {
    color: #c97900
}

.security-note{
    display:flex;
    justify-content:center;
    align-items:center;
    margin-top:28px;
    text-align:center;
}

.security-note div{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:6px;
}

.security-note strong{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    color:#1765d4;
    font-size:15px;
    font-weight:700;
    line-height:1;
}

.security-note strong i{
    font-size:22px;
    line-height:1;
}

.security-note strong span{
    display:block;
}

.security-note small{
    color:#6c7a96;
    font-size:13px;
    font-weight:400;
    line-height:1.5;
}

.is-loading {
    pointer-events: none;
    opacity: .65
}

.is-loading .action-arrow i:before {
    content: "\f110"
}

.is-loading .action-arrow i {
    animation: spin .8s linear infinite
}

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

@media (max-width:900px) {
    .portal-page {
        padding: 24px 14px
    }

    .portal-shell {
        padding: 30px 20px
    }

    .portal-logo {
        width: 120px;
        height: 120px
    }

    .portal-header h1 {
        font-size: 28px
    }

    .portal-actions {
        grid-template-columns: 1fr 1fr
    }

    .action-card,
    .action-wide {
        grid-column: span 1
    }

    .captcha-card {
        padding: 18px
    }

    .captcha-question-wrap {
        gap: 14px
    }

    .captcha-question {
        font-size: 24px
    }

    .captcha-input {
        width: 160px
    }
}

@media (max-width:640px) {
    .portal-page {
        align-items: flex-start;
        padding-top: 20px
    }

    .portal-shell {
        border-radius: 22px;
        padding: 24px 14px
    }

    .portal-header {
        margin-bottom: 18px
    }

    .portal-logo {
        width: 104px;
        height: 104px;
        margin-bottom: 12px
    }

    .portal-header h1 {
        font-size: 24px
    }

    .portal-header p {
        font-size: 14px
    }

    .captcha-card {
        min-height: auto;
        align-items: flex-start;
        gap: 14px;
        padding: 16px;
        border-radius: 16px
    }

    .captcha-icon {
        width: 54px;
        height: 54px
    }

    .captcha-icon i {
        font-size: 22px
    }

    .captcha-question-wrap {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 10px
    }

    .captcha-question {
        font-size: 21px
    }

    .captcha-input {
        width: 100%;
        height: 48px
    }

    .captcha-submit {
        height: 48px;
        width: 50px
    }

    .portal-actions {
        grid-template-columns: 1fr;
        gap: 12px
    }

    .action-card,
    .action-wide {
        min-height: 82px
    }

    .action-text strong {
        font-size: 16px
    }

    .action-text small {
        font-size: 13px
    }

    .security-note {
        margin-top: 24px;
        align-items: flex-start
    }

    .security-note span {
        font-size: 12px
    }
}

@media (max-width:390px) {
    .captcha-card {
        flex-direction: column
    }

    .captcha-question-wrap {
        grid-template-columns: 1fr
    }

    .captcha-submit {
        width: 100%
    }

    .action-card {
        padding: 13px 14px
    }

    .action-icon {
        width: 48px;
        height: 48px
    }

    .action-text strong {
        font-size: 15px
    }

    .action-text small {
        font-size: 12px
    }
}


/* Compact update: smaller typography and no captcha submit button */
.portal-shell {
    max-width: 980px;
    padding: 34px 42px 30px
}

.portal-logo {
    width: 118px;
    height: 118px;
    margin-bottom: 14px
}

.portal-header {
    margin-bottom: 20px
}

.portal-header h1 {
    font-size: 30px;
    line-height: 1.15
}

.portal-header p {
    font-size: 15px
}

.captcha-card {
    max-width: 640px;
    min-height: 74px;
    padding: 14px 24px;
    margin-bottom: 18px
}

.captcha-icon {
    width: 56px;
    height: 56px
}

.captcha-icon i {
    font-size: 23px
}

.captcha-question-wrap {
    justify-content: center;
    gap: 18px
}

.captcha-question {
    font-size: 25px
}

.captcha-input {
    width: 190px;
    height: 48px;
    font-size: 14px;
    border-radius: 10px
}

.captcha-submit {
    display: none !important
}

.portal-actions {
    gap: 14px
}

.action-card {
    min-height: 78px;
    padding: 14px 17px;
    border-radius: 15px;
    gap: 14px
}

.action-icon {
    width: 48px;
    height: 48px;
    font-size: 20px
}

.action-text strong {
    font-size: 15px
}

.action-text small {
    font-size: 13px
}

.action-arrow {
    font-size: 17px
}

.security-note {
    margin-top: 24px
}

.security-note i {
    font-size: 20px
}

.security-note strong {
    font-size: 13px
}

.security-note span {
    font-size: 12px
}

.captcha-message {
    margin-top: 8px;
    font-weight: 600;
    font-size: 13px;
    min-height: 20px;
    margin: -4px 0 10px;
    text-align: center;
}

.captcha-message.error {
    color: #dc2626;
}

.captcha-message.success {
    color: #16a34a;
}

@media (max-width:900px) {
    .portal-shell {
        padding: 28px 18px
    }

    .portal-logo {
        width: 104px;
        height: 104px
    }

    .portal-header h1 {
        font-size: 25px
    }

    .portal-header p {
        font-size: 13px
    }

    .captcha-card {
        padding: 14px 16px
    }

    .captcha-question {
        font-size: 22px
    }

    .captcha-input {
        height: 46px;
        width: 160px
    }

    .action-card {
        min-height: 74px
    }

    .action-text strong {
        font-size: 14px
    }

    .action-text small {
        font-size: 12px
    }
}

@media (max-width:640px) {
    .portal-logo {
        width: 92px;
        height: 92px
    }

    .portal-header h1 {
        font-size: 22px
    }

    .captcha-card {
        align-items: center
    }

    .captcha-question-wrap {
        grid-template-columns: auto 1fr;
        gap: 10px
    }

    .captcha-question {
        font-size: 20px
    }

    .captcha-input {
        height: 44px
    }

    .action-icon {
        width: 44px;
        height: 44px;
        font-size: 18px
    }

    .action-card {
        min-height: 70px;
        padding: 12px 14px
    }

    .security-note {
        margin-top: 18px
    }
}

@media (max-width:390px) {
    .captcha-question-wrap {
        grid-template-columns: auto 1fr
    }

    .captcha-card {
        flex-direction: row
    }

    .captcha-input {
        min-width: 0
    }

    .action-text strong {
        font-size: 13px
    }

    .action-text small {
        font-size: 11px
    }
}

/* Final separated button layout */

.portal-buttons-wrap {
    width: 100%;
    position: relative;
    z-index: 1;
}

.registration-actions,
.extra-registration-actions,
.login-actions {
    width: 100%;
    display: grid;
    gap: 20px;
}

.registration-actions {
    margin-bottom: 28px;
}

.extra-registration-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 28px;
}

.login-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.registration-actions.registration-single {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.registration-actions.registration-single .action-card {
    grid-column: 1 / -1;
    width: 50%;
    justify-self: center;
}

.registration-actions.registration-double {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.registration-actions.registration-double .action-card,
.extra-registration-actions .action-card,
.login-actions .action-card {
    width: 100%;
    grid-column: auto;
}

.portal-buttons-wrap .action-card {
    min-height: 84px;
}

.portal-buttons-wrap .action-wide {
    grid-column: auto;
}

@media (max-width: 900px) {
    .registration-actions.registration-single,
    .registration-actions.registration-double,
    .extra-registration-actions,
    .login-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .registration-actions.registration-single .action-card {
        width: 50%;
    }
}

@media (max-width: 640px) {
    .registration-actions.registration-single,
    .registration-actions.registration-double,
    .extra-registration-actions,
    .login-actions {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .registration-actions,
    .extra-registration-actions {
        margin-bottom: 18px;
    }

    .registration-actions.registration-single .action-card {
        width: 100%;
    }
}