* {
    box-sizing: border-box;
}

:root {
    --primary: #003b7a;
    --primary-dark: #002b5c;
    --primary-light: #0d7bdc;
    --accent: #f5a400;
    --accent-dark: #d88b00;
    --text: #102033;
    --muted: #64748b;
    --line: #e2e8f0;
    --soft: #f3f6fb;
    --white: #ffffff;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(245, 164, 0, 0.28), transparent 30%),
        radial-gradient(circle at bottom right, rgba(0, 59, 122, 0.35), transparent 36%),
        linear-gradient(135deg, var(--primary-dark) 0%, #0056a8 48%, var(--primary-light) 100%);
}

.page {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.portal-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 28px 80px rgba(0, 20, 50, 0.35);
}

.portal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.logo-mark {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), #0068c9);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    letter-spacing: 0.5px;
    border: 4px solid rgba(245, 164, 0, 0.35);
}

.brand-content {
    min-width: 0;
}

.school-name {
    font-size: 17px;
    line-height: 1.35;
    font-weight: 800;
    color: var(--primary-dark);
}

.portal-name {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}

.hero {
    text-align: left;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(245, 164, 0, 0.16);
    color: #9a6500;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
}

h1 {
    margin: 0;
    font-size: clamp(24px, 6vw, 30px);
    line-height: 1.18;
    color: var(--text);
}

.description {
    margin: 14px 0 22px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.notice {
    background: var(--soft);
    border: 1px solid var(--line);
    border-left: 5px solid var(--accent);
    border-radius: 18px;
    padding: 14px 16px;
    color: #334155;
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 18px;
}

.login-button {
    display: block;
    width: 100%;
    padding: 16px;
    min-height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #1f2937;
    text-align: center;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.35;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(245, 164, 0, 0.32);
    -webkit-tap-highlight-color: transparent;
}

.login-button:hover {
    filter: brightness(1.02);
}

.login-button:active {
    transform: translateY(1px);
}

.terms {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.portal-footer {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

/* Tablet */
@media (max-width: 768px) {
    .portal-card {
        max-width: 440px;
    }
}

/* Mobile chung */
@media (max-width: 520px) {
    .page {
        align-items: flex-start;
        padding: 20px 14px;
    }

    .portal-card {
        max-width: 100%;
        margin-top: 0;
    }

    .portal-header {
        margin-bottom: 22px;
    }

    h1 {
        font-size: 28px;
    }

    .description {
        margin-bottom: 18px;
    }

    .notice {
        margin-bottom: 18px;
    }
}

/* Điện thoại phổ thông */
@media (max-width: 480px) {
    .page {
        align-items: stretch;
        padding: 14px;
    }

    .portal-card {
        margin: auto 0;
        padding: 24px;
        border-radius: 24px;
    }

    .portal-header {
        align-items: flex-start;
        margin-bottom: 24px;
    }

    .logo-mark {
        width: 58px;
        height: 58px;
        border-radius: 18px;
        font-size: 16px;
    }

    .school-name {
        font-size: 16px;
    }

    .description {
        font-size: 14px;
    }

    .notice {
        font-size: 13px;
    }
}

/* Màn hình nhỏ: iPhone SE / Android nhỏ */
@media (max-width: 390px) {
    .portal-card {
        padding: 22px;
    }

    h1 {
        font-size: 24px;
    }

    .school-name {
        font-size: 15px;
    }

    .description,
    .notice {
        font-size: 13px;
    }

    .login-button {
        min-height: 52px;
        font-size: 15px;
    }
}

/* Màn rất nhỏ */
@media (max-width: 360px) {
    .page {
        padding: 10px;
    }

    .portal-card {
        padding: 20px;
        border-radius: 22px;
    }

    .portal-header {
        gap: 10px;
    }

    .logo-mark {
        width: 50px;
        height: 50px;
        border-radius: 16px;
        font-size: 14px;
        border-width: 3px;
    }

    .school-name {
        font-size: 14px;
    }

    .portal-name {
        font-size: 12px;
    }

    .badge {
        font-size: 11px;
        padding: 6px 10px;
    }

    .login-button {
        font-size: 15px;
        padding: 14px;
    }
}

/* Màn thấp: captive portal popup / điện thoại nhỏ */
@media (max-height: 720px) {
    .page {
        align-items: flex-start;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .portal-card {
        padding-top: 22px;
        padding-bottom: 22px;
    }

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

    .badge {
        margin-bottom: 10px;
    }

    .description {
        margin: 12px 0 16px;
    }

    .notice {
        padding: 12px 14px;
        margin-bottom: 14px;
    }

    .terms {
        margin-top: 12px;
    }

    .portal-footer {
        margin-top: 12px;
        padding-top: 12px;
    }
}