/* ── CORE RESET & VARIABLES ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563EB;
    --primary-dk: #1D4ED8;
    --primary-lt: #EFF6FF;
    --success: #16A34A;
    --success-lt: #DCFCE7;
    --success-bdr: #86EFAC;
    --danger: #DC2626;
    --danger-lt: #FEE2E2;
    --danger-bdr: #FCA5A5;
    --text: #0F172A;
    --text-muted: #64748B;
    --bg: #F1F5F9;
    --card: #FFFFFF;
    --border: #E2E8F0;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(15, 23, 42, .07);
    --shadow-sm: 0 1px 4px rgba(15, 23, 42, .08);
    --transition: .2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 660px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ── HEADER ─────────────────────────────────────────────── */
.site-header {
    background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 12px rgba(37, 99, 235, .35);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.brand-icon {
    font-size: 1.4rem;
}

.site-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

/* ── USER NAV ───────────────────────────────────────────── */
.user-nav {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .6);
    object-fit: cover;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-name {
    font-weight: 600;
    font-size: .9rem;
}

.user-email {
    font-size: .78rem;
    opacity: .75;
}

/* ── MAIN ───────────────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 2rem 0 3rem;
}

/* ── CARDS ──────────────────────────────────────────────── */
.welcome-card,
.form-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.25rem;
    margin-bottom: 1.5rem;
}

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

.welcome-icon {
    font-size: 4.5rem;
    margin-bottom: 1rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.welcome-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .75rem;
    color: var(--text);
}

.welcome-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* ── FORM CARD ──────────────────────────────────────────── */
.form-header {
    margin-bottom: 1.75rem;
}

.form-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: .35rem;
}

.form-subtitle {
    color: var(--text-muted);
    font-size: .9rem;
}

/* ── FORM NOTICE (thông báo mô tả) ─────────────────────── */
.form-notice {
    margin-top: .9rem;
    font-size: .92rem;
    line-height: 1.75;
    color: var(--text);
}

.form-notice p {
    margin-bottom: .85rem;
    text-align: justify;
}

.form-notice p:last-of-type {
    margin-bottom: .5rem;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: .5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.contact-list li {
    font-size: .92rem;
}

.contact-list a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.contact-list a:hover {
    text-decoration: underline;
}

.form-divider {
    border: none;
    border-top: 1.5px dashed var(--border);
    margin: 1.5rem 0;
}

/* ── FORM ELEMENTS ──────────────────────────────────────── */
.form-group {
    margin-bottom: 1.35rem;
}

label {
    display: block;
    font-weight: 600;
    font-size: .875rem;
    margin-bottom: .45rem;
    color: var(--text);
}

.required {
    color: var(--danger);
    margin-left: 2px;
}

/* Select wrapper với arrow tùy chỉnh */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▾';
    position: absolute;
    right: .9rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: .85rem;
}

input[type="text"],
input[type="tel"],
input[type="email"],
select {
    width: 100%;
    padding: .7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.input-readonly {
    background: var(--bg) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    border-style: dashed;
}

.field-hint {
    display: block;
    font-size: .78rem;
    color: var(--success);
    margin-top: .3rem;
}

/* ── SLOTS INFO ─────────────────────────────────────────── */
.slots-info {
    font-size: .82rem;
    margin-top: .35rem;
    font-weight: 600;
    min-height: 1.2em;
    transition: color var(--transition);
}

.slots-available {
    color: var(--success);
}

.slots-full {
    color: var(--danger);
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1.35rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background var(--transition), box-shadow var(--transition), transform .1s;
    white-space: nowrap;
}

.btn:active {
    transform: scale(.96);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .30);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dk);
    box-shadow: 0 4px 16px rgba(37, 99, 235, .40);
}

.btn-primary:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-google {
    background: #fff;
    color: #3c4043;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}

.btn-outline {
    background: transparent;
    color: rgba(255, 255, 255, .9);
    border: 1.5px solid rgba(255, 255, 255, .5);
    font-size: .85rem;
    padding: .5rem 1rem;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .8);
}

.btn-large {
    padding: .9rem 2.25rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    margin-top: .75rem;
}

/* ── ALERTS ─────────────────────────────────────────────── */
.alert {
    padding: .9rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.35rem;
    font-weight: 500;
    font-size: .9rem;
    border-left: 4px solid transparent;
    animation: slideDown .2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: var(--success-lt);
    color: #15803D;
    border-left-color: var(--success);
    border: 1px solid var(--success-bdr);
    border-left: 4px solid var(--success);
}

.alert-error {
    background: var(--danger-lt);
    color: #B91C1C;
    border-left-color: var(--danger);
    border: 1px solid var(--danger-bdr);
    border-left: 4px solid var(--danger);
}

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: .8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--card);
}

/* ── CONFIRMATION CARD ──────────────────────────────────── */
.confirm-card {
    text-align: center;
    padding: .5rem 0;
}

.confirm-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    animation: pop .4s cubic-bezier(.175, .885, .32, 1.275);
}

@keyframes pop {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.confirm-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: .4rem;
}

.confirm-sub {
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 1.75rem;
}

.confirm-table {
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    overflow: hidden;
    margin-bottom: 1.75rem;
    text-align: left;
}

.confirm-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: .7rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.confirm-row:last-child {
    border-bottom: none;
}

.confirm-label {
    flex: 0 0 165px;
    font-size: .825rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.confirm-value {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text);
    word-break: break-word;
}

.confirm-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .welcome-card,
    .form-card {
        padding: 1.5rem 1.25rem;
    }

    .welcome-card h2 {
        font-size: 1.25rem;
    }

    .site-title {
        font-size: 1rem;
    }

    .user-info {
        display: none;
    }

    .confirm-label {
        flex: 0 0 130px;
        font-size: .78rem;
    }
}

/* ── PRINT ──────────────────────────────────────────────── */
@media print {

    .site-header,
    .confirm-actions,
    .site-footer {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .form-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .confirm-table {
        border: 1px solid #ccc;
    }
}