:root {
    --bg: #eff4fb;
    --surface: #ffffff;
    --surface-soft: #f5f9ff;
    --surface-strong: #eef4ff;
    --primary: #0b3d91;
    --primary-soft: #e7f0ff;
    --accent: #1e88e5;
    --text: #1c2532;
    --muted: #5f6b7d;
    --danger: #d32f2f;
    --border: rgba(16, 24, 40, 0.12);
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top left, rgba(14, 82, 189, 0.16), transparent 30%),
                linear-gradient(180deg, #f8fbff 0%, #eff4fb 100%);
    color: var(--text);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.login-container {
    width: 100%;
    max-width: 1080px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 30px;
}

.login-panel {
    background: var(--surface);
    border-radius: 32px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    min-height: 540px;
}

.login-hero {
    padding: 48px 44px;
    background: linear-gradient(135deg, #0b3d91, #1976d2);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mijo-logo {
    display: block;
    width: 100%;
    height: auto;
}

.login-hero-logo {
    max-width: 540px;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.18));
}

.brand-block h1 {
    margin: 0;
    font-size: 32px;
    letter-spacing: 0.06em;
}

.brand-block p {
    margin: 8px 0 0;
    max-width: 340px;
    font-size: 15px;
    line-height: 1.75;
    opacity: 0.92;
}

.hero-text {
    margin: 30px 0 0;
    font-size: 16px;
    line-height: 1.8;
    max-width: 420px;
    opacity: 0.95;
}

.feature-list {
    margin-top: 32px;
    display: grid;
    gap: 14px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 15px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.93);
}

.feature-item span {
    min-width: 36px;
    min-height: 36px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.16);
}

.login-form-box {
    padding: 44px 40px;
}

.form-header h2 {
    margin: 0;
    font-size: 32px;
    color: var(--text);
}

.form-header p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.form-group {
    margin-top: 22px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
}

input {
    width: 100%;
    border: 1px solid rgba(16, 24, 40, 0.14);
    border-radius: 16px;
    padding: 14px 16px;
    background: #fff;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 6px rgba(14, 82, 189, 0.12);
}

.btn-primary {
    width: 100%;
    border: none;
    border-radius: 16px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #0b3d91, #1e88e5);
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    margin-top: 20px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-primary:hover {
    opacity: 0.96;
    transform: translateY(-1px);
}

.alert {
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #f2c1c5;
    background: #fff0f1;
    color: #9d1a1f;
}

.form-footer {
    margin-top: 28px;
    font-size: 14px;
    color: var(--muted);
    text-align: center;
}

.login-note {
    margin-top: 24px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(14, 82, 189, 0.06);
    color: rgba(14, 82, 189, 0.98);
    font-size: 14px;
    line-height: 1.7;
}

/* Dashboard layout */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 320px;
    min-width: 320px;
    background: #0b3d91;
    color: #ffffff;
    padding: 34px 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.sidebar .brand-block {
    display: block;
}

.sidebar-logo {
    max-width: 250px;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    background: #ffffff;
    color: #0b3d91;
    font-weight: 900;
    display: grid;
    place-items: center;
    font-size: 18px;
}

.profile-name {
    font-weight: 800;
    font-size: 15px;
}

.profile-role {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.nav-menu {
    display: grid;
    gap: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 18px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 600;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(1px);
}

.nav-item-active {
    background: rgba(255, 255, 255, 0.24);
}

.nav-item-logout {
    margin-top: 12px;
    background: #e35d5d;
}

.content-wrapper {
    flex: 1;
    padding: 34px 40px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.page-title h1 {
    font-size: 34px;
    color: var(--primary);
    margin: 0;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-emblem {
    width: 44px;
    min-width: 44px;
    height: 44px;
}

.page-title p {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 15px;
    max-width: 740px;
    line-height: 1.8;
}

.topbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.topbar-chip {
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(14, 82, 189, 0.12);
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

.topbar-date {
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin-top: 28px;
}

.card {
    background: var(--surface);
    border-radius: 28px;
    padding: 26px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(16, 24, 40, 0.06);
}

.card h3 {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.card .value {
    font-size: 42px;
    line-height: 1;
    color: var(--primary);
    font-weight: 800;
}

.card small {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.section-card {
    background: var(--surface);
    border-radius: 28px;
    padding: 26px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(16, 24, 40, 0.06);
}

.section-card h2 {
    margin: 0 0 16px;
    color: var(--primary);
    font-size: 22px;
}

.section-card p,
.section-card li {
    color: var(--muted);
    line-height: 1.75;
    font-size: 15px;
}

.section-card ul {
    padding-left: 18px;
    margin: 0;
}

.section-card li {
    margin-bottom: 12px;
}

.button-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    margin-top: 18px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.button-link:hover {
    opacity: 0.96;
    transform: translateY(-1px);
}

.alert-box {
    margin-top: 12px;
    padding: 18px 20px;
    border-radius: 20px;
    background: #fff3db;
    border: 1px solid #ffe5b4;
    color: #825600;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
}

.detail-table th,
.detail-table td {
    text-align: left;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(16, 24, 40, 0.08);
}

.detail-table th {
    color: var(--muted);
    background: rgba(14, 82, 189, 0.04);
    font-weight: 700;
}

.detail-table td {
    color: var(--text);
}

@media (max-width: 1100px) {
    .login-container,
    .main-wrapper {
        flex-direction: column;
    }

    .main-wrapper {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        min-width: auto;
        height: auto;
    }

    .content-wrapper {
        padding: 24px;
    }
}

/* Registration flow */
.registration-page {
    margin-top: 24px;
    display: grid;
    gap: 24px;
}

.registration-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
    align-items: stretch;
}

.registration-hero > div:first-child,
.registration-badge-card,
.registration-panel {
    background: var(--surface);
    border-radius: 28px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(16, 24, 40, 0.06);
}

.registration-hero > div:first-child {
    padding: 30px;
    background:
        radial-gradient(circle at top right, rgba(255, 193, 7, 0.16), transparent 26%),
        radial-gradient(circle at bottom left, rgba(30, 136, 229, 0.16), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f6fbff 100%);
}

.registration-theme-student .registration-hero > div:first-child {
    border-top: 6px solid #1e88e5;
}

.registration-theme-family .registration-hero > div:first-child {
    border-top: 6px solid #00a896;
}

.registration-theme-school .registration-hero > div:first-child {
    border-top: 6px solid #f97316;
}

.registration-kicker {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(11, 61, 145, 0.08);
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 12px;
}

.registration-hero h2 {
    margin: 16px 0 12px;
    font-size: 34px;
    color: #132238;
}

.registration-hero p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
    font-size: 15px;
    max-width: 720px;
}

.registration-badge-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(150deg, #0b3d91 0%, #1e88e5 52%, #60a5fa 100%);
    color: #ffffff;
}

.registration-badge-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    opacity: 0.84;
}

.registration-badge-value {
    margin-top: 8px;
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
}

.registration-badge-note {
    margin-top: 10px;
    font-size: 15px;
    opacity: 0.92;
}

.registration-stepper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr) 60px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(16, 24, 40, 0.08);
}

.step-item strong,
.step-item small {
    display: block;
}

.step-item strong {
    color: #213147;
    font-size: 15px;
}

.step-item small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.step-index {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: #ffffff;
    background: linear-gradient(135deg, #94a3b8, #64748b);
    flex-shrink: 0;
}

.step-item.step-active {
    background: linear-gradient(135deg, rgba(11, 61, 145, 0.12), rgba(30, 136, 229, 0.12));
    border-color: rgba(30, 136, 229, 0.28);
}

.step-item.step-active .step-index {
    background: linear-gradient(135deg, #0b3d91, #1e88e5);
}

.step-item.step-done .step-index {
    background: linear-gradient(135deg, #059669, #34d399);
}

.step-line {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(11, 61, 145, 0.2), rgba(30, 136, 229, 0.46), rgba(249, 115, 22, 0.24));
}

.registration-alert {
    padding: 16px 18px;
    border-radius: 18px;
    font-weight: 700;
}

.registration-alert-error {
    background: #fff1f2;
    color: #a61b29;
    border: 1px solid #fecdd3;
}

.registration-form-shell {
    display: grid;
    gap: 24px;
}

.registration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.registration-panel {
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.registration-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.9), transparent 28%);
}

.registration-panel-full {
    grid-column: 1 / -1;
}

.panel-primary {
    background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%);
}

.panel-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #f7fffb 100%);
}

.panel-accent {
    background: linear-gradient(180deg, #fffdf7 0%, #fff7ed 100%);
}

.panel-header {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 22px;
    z-index: 1;
}

.panel-dot {
    width: 16px;
    height: 16px;
    margin-top: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1e88e5, #f97316);
    box-shadow: 0 0 0 8px rgba(30, 136, 229, 0.08);
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    color: #12243a;
    font-size: 22px;
}

.panel-header p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.75;
    font-size: 14px;
}

.registration-fields {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 18px;
}

.registration-fields.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-span-2 {
    grid-column: span 2;
}

.registration-field {
    margin-top: 0;
}

.registration-field label {
    margin-bottom: 8px;
}

.registration-page input,
.registration-page select,
.registration-page textarea {
    width: 100%;
    border: 1px solid rgba(16, 24, 40, 0.14);
    border-radius: 18px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.registration-page textarea {
    min-height: 140px;
    resize: vertical;
}

.registration-page input:focus,
.registration-page select:focus,
.registration-page textarea:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 6px rgba(30, 136, 229, 0.12);
    transform: translateY(-1px);
}

.upload-zone {
    position: relative;
    z-index: 1;
    border: 2px dashed rgba(249, 115, 22, 0.34);
    border-radius: 24px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.72);
}

.upload-label {
    display: inline-flex;
    padding: 10px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 14px;
}

.upload-zone p {
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

.registration-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.button-link-muted {
    background: rgba(11, 61, 145, 0.08);
    color: var(--primary);
}

.registration-submit {
    border: none;
}

.registration-submit:hover,
.button-link-muted:hover {
    transform: translateY(-1px);
}

.registration-highlight-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.registration-highlight-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(16, 24, 40, 0.06);
    color: #213147;
    font-weight: 600;
}

.registration-highlight-item span {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0b3d91, #1e88e5);
    color: #ffffff;
    font-size: 14px;
    flex-shrink: 0;
}

@media (max-width: 1200px) {
    .registration-hero,
    .registration-grid {
        grid-template-columns: 1fr;
    }

    .registration-badge-card {
        min-height: 180px;
    }
}

@media (max-width: 980px) {
    .registration-stepper {
        grid-template-columns: 1fr;
    }

    .step-line {
        display: none;
    }
}

@media (max-width: 720px) {
    .registration-fields.two-columns {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: auto;
    }

    .registration-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .registration-actions .button-link,
    .registration-actions .registration-submit {
        width: 100%;
        justify-content: center;
    }

    .registration-hero h2 {
        font-size: 28px;
    }
}

@media (max-width: 760px) {
    .login-container {
        grid-template-columns: 1fr;
    }

    .login-panel {
        grid-template-columns: 1fr;
    }

    .login-hero,
    .login-form-box {
        padding: 28px 24px;
    }

    .sidebar {
        padding: 24px 18px;
    }

    .content-wrapper {
        padding: 20px;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }
}
