:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --success: #059669;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 30%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 30%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    margin-top: 18px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 22px;
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 16px;
    z-index: 10;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--muted);
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 14px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background: var(--surface-2);
}

.nav-toggle {
    display: none;
    border: 0;
    background: var(--surface-2);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 20px;
}

.logout-form {
    margin: 0;
}

.main {
    flex: 1;
    padding: 42px 0;
}

.footer {
    padding: 24px 0 36px;
    color: var(--muted);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid rgba(229, 231, 235, 0.8);
}

.hero {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 28px;
    align-items: stretch;
}

.hero-content,
.hero-card,
.card,
.auth-card,
.metric-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-content {
    padding: clamp(32px, 6vw, 72px);
}

.hero h1 {
    font-size: clamp(38px, 6vw, 70px);
    line-height: 0.98;
    letter-spacing: -0.07em;
    margin: 12px 0 20px;
}

.hero p {
    max-width: 660px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.75;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.14);
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero-actions,
.form-actions,
.badge-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-card {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-card h3 {
    margin: 20px 0 12px;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.status-pill {
    align-self: flex-start;
    padding: 8px 12px;
    border-radius: 999px;
    color: #075985;
    background: #e0f2fe;
    font-weight: 700;
    font-size: 13px;
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
    color: var(--muted);
}

.check-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.check-list li::before {
    content: "✓";
    color: var(--success);
    font-weight: 900;
}

.check-list.dark {
    color: var(--text);
}

.grid {
    display: grid;
    gap: 22px;
}

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

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 22px;
}

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

.card,
.metric-card {
    padding: 26px;
}

.feature-card h3,
.card h3,
.card h2 {
    margin-top: 0;
    letter-spacing: -0.04em;
}

.feature-card p,
.card p {
    color: var(--muted);
    line-height: 1.65;
}

.icon-box {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--surface-2);
    margin-bottom: 18px;
    font-size: 22px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 15px;
    padding: 11px 16px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-family: inherit;
    font-size: 14px;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0891b2);
    color: #fff;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), #0e7490);
}

.btn-outline {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--line);
}

.btn-light {
    color: var(--text);
    background: var(--surface-2);
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--text);
    color: #fff;
}

.auth-wrap {
    min-height: 68vh;
    display: grid;
    place-items: center;
    padding: 20px 0;
}

.auth-wrap.wide .auth-card {
    max-width: 820px;
}

.auth-wrap.no-pad {
    min-height: auto;
    place-items: stretch;
    padding: 0;
}

.auth-card {
    width: min(100%, 520px);
    padding: 32px;
}

.auth-heading {
    margin-bottom: 24px;
}

.auth-heading h1,
.page-head h1 {
    margin: 12px 0 8px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.06em;
}

.auth-heading p,
.page-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.form {
    display: grid;
    gap: 18px;
}

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

.form-group {
    display: grid;
    gap: 8px;
}

.form-group span {
    font-weight: 800;
    font-size: 14px;
}

.form-group small {
    color: var(--muted);
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
    color: var(--text);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(37, 99, 235, 0.65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.09);
}

textarea {
    resize: vertical;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.center {
    text-align: center;
}

.demo-box {
    margin-top: 18px;
    padding: 14px;
    border-radius: 16px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 14px;
}

.alert,
.form-errors {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    font-weight: 700;
}

.alert-success {
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
}

.alert-error,
.form-errors {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.form-errors {
    display: grid;
    gap: 6px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.page-head.compact {
    margin-bottom: 16px;
}

.profile-card {
    text-align: center;
}

.avatar {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    color: #fff;
    font-size: 34px;
    font-weight: 900;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.badge.success {
    background: #d1fae5;
    color: #065f46;
}

.badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.info-list {
    display: grid;
    gap: 14px;
}

.info-list div {
    display: grid;
    gap: 4px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.info-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.info-list span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.mt {
    margin-top: 22px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-title h3,
.section-title p {
    margin: 0;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 190px;
    border: 1px dashed var(--line);
    border-radius: 20px;
    color: var(--muted);
    text-align: center;
    background: var(--surface-2);
}

.empty-state div {
    font-size: 38px;
}

.metric-card {
    display: grid;
    gap: 10px;
}

.metric-card span {
    color: var(--muted);
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-card strong {
    font-size: 34px;
    letter-spacing: -0.06em;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.toolbar input {
    max-width: 380px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form select {
    width: auto;
    min-width: 100px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
}

.error-page {
    max-width: 680px;
    margin: 60px auto;
    text-align: center;
}

.error-code {
    font-size: 86px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.08em;
}

@media (max-width: 900px) {
    .hero,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .page-head,
    .footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .topbar {
        align-items: flex-start;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav {
        display: none;
        position: absolute;
        left: 16px;
        right: 16px;
        top: 68px;
        padding: 14px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 18px;
        box-shadow: var(--shadow);
        flex-direction: column;
        align-items: stretch;
    }

    .nav.open {
        display: flex;
    }

    .logout-form .btn,
    .nav .btn {
        width: 100%;
    }

    .form-grid,
    .toolbar {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .toolbar input {
        max-width: none;
    }

    .hero-content,
    .auth-card,
    .card,
    .metric-card {
        padding: 22px;
    }
}

.avatar-image {
    object-fit: cover;
    display: block;
}

.avatar-editor {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-2);
}

.avatar-editor .avatar {
    flex: 0 0 auto;
    margin: 0;
}

.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text);
}

.checkbox-line input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.member-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-mini {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    color: #fff;
    font-weight: 900;
}

img.avatar-mini {
    object-fit: cover;
}

@media (max-width: 640px) {
    .avatar-editor {
        align-items: flex-start;
        flex-direction: column;
    }
}

img.avatar-mini {
    display: block;
}

/* Minecraft Slot module */
.mc-card {
    position: relative;
    overflow: hidden;
}

.mc-card::after {
    content: "";
    position: absolute;
    inset: auto -40px -80px auto;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    pointer-events: none;
}

.mc-card.highlight {
    border-color: rgba(37, 99, 235, 0.2);
}

.mc-icon,
.pay-mc-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(5, 150, 105, 0.12));
    border: 1px solid rgba(37, 99, 235, 0.12);
    font-size: 28px;
    margin-bottom: 18px;
}

.mc-register-card {
    width: 100%;
}

.price-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.price-box span {
    color: var(--muted);
    font-weight: 800;
}

.price-box strong {
    font-size: 28px;
    letter-spacing: -0.04em;
    color: var(--primary);
}

.pay-mc-wrap {
    min-height: 72vh;
    display: grid;
    place-items: center;
}

.pay-mc-card {
    width: min(100%, 520px);
    padding: 28px;
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.92));
    border: 1px solid rgba(229, 231, 235, 0.95);
    box-shadow: var(--shadow);
}

.pay-mc-header {
    text-align: center;
    margin-bottom: 18px;
}

.pay-mc-icon {
    margin: 0 auto 14px;
}

.pay-mc-header h1 {
    margin: 12px 0 8px;
    font-size: clamp(30px, 5vw, 44px);
    letter-spacing: -0.06em;
    line-height: 1.02;
}

.pay-mc-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.qr-frame-mc {
    width: min(100%, 340px);
    margin: 18px auto;
    padding: 12px;
    border-radius: 26px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, var(--primary), #06b6d4, #10b981) border-box;
    border: 2px solid transparent;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.qr-frame-mc img {
    width: 100%;
    display: block;
    border-radius: 18px;
}

.pay-detail-grid {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.pay-detail-grid div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fff;
}

.pay-detail-grid span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.pay-detail-grid strong {
    text-align: right;
    word-break: break-word;
}

.status-box-mc {
    margin-top: 16px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 18px;
    color: #075985;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    font-weight: 900;
    text-align: center;
    padding: 12px 14px;
}

.status-box-mc.success {
    color: #065f46;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.status-dot-mc {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #0284c7;
    flex: 0 0 auto;
    box-shadow: 0 0 0 rgba(2, 132, 199, 0.7);
    animation: mcPulse 1.6s infinite;
}

.status-box-mc.success .status-dot-mc {
    background: var(--success);
    animation: none;
}

.pay-actions {
    justify-content: center;
    margin-top: 16px;
}

@keyframes mcPulse {
    0% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.55); }
    70% { box-shadow: 0 0 0 10px rgba(2, 132, 199, 0); }
    100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}

@media (max-width: 640px) {
    .pay-mc-card {
        padding: 20px;
        border-radius: 24px;
    }

    .pay-detail-grid div {
        align-items: flex-start;
        flex-direction: column;
    }

    .pay-detail-grid strong {
        text-align: left;
    }
}

/* Auth security additions */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.checkbox-line.compact {
    font-size: 14px;
}

.checkbox-line.compact input[type="checkbox"] {
    width: 18px;
    height: 18px;
    padding: 0;
}

.auth-link {
    font-weight: 800;
    font-size: 14px;
}

/* Small additions for PHP-thuan pages */
.avatar-large {
    width: 92px;
    height: 92px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    color: #fff;
    font-size: 34px;
    font-weight: 900;
    flex: 0 0 auto;
}

img.avatar-large {
    object-fit: cover;
}

.qr-image {
    width: min(100%, 340px);
    display: block;
    margin: 18px auto;
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.soft-separator {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 22px 0;
}
