:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #0f172a;
    --accent: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --border-focus: #818cf8;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.checkin-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.2;
}

.brand-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lang-selector select {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.lang-selector select:focus {
    border-color: var(--primary);
}

/* Main */
.checkin-main {
    padding: 2rem 0 4rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Booking Summary Card */
.booking-summary-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #ffffff;
    border: none;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-booking {
    background: var(--success);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.booking-ref {
    font-size: 0.9rem;
    color: #c7d2fe;
}

.booking-ref strong {
    color: #ffffff;
    font-family: monospace;
    font-size: 1rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.summary-label {
    display: block;
    font-size: 0.8rem;
    color: #a5b4fc;
    margin-bottom: 0.25rem;
}

.summary-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.summary-sub {
    display: block;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.booking-notice {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #e0e7ff;
    line-height: 1.4;
}

/* Guest Cards */
.guest-card {
    border-top: 4px solid var(--primary);
}

.guest-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.guest-num-badge {
    background: var(--primary-light);
    color: var(--primary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
}

.guest-card-title-box h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
}

.guest-status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Sections inside guest card */
.form-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.25rem 0 0.75rem;
}

.form-section-title span {
    background: #e2e8f0;
    color: var(--secondary);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.minor-toggle-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.minor-help-text {
    font-size: 0.85rem;
    color: #92400e;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Form Controls */
.form-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.form-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.form-group label.required::after {
    content: " *";
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.3;
}

.field-feedback {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-weight: 600;
}

.field-feedback.valid {
    color: var(--success);
}

.field-feedback.invalid {
    color: var(--danger);
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
    gap: 0.75rem;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 22px;
    width: 22px;
    background-color: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.2s;
    display: inline-block;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-container .checkmark::after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Support Help Button */
.btn-help-support {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: 0.5rem;
    text-decoration: underline;
}

/* Signature Pad */
.sig-instructions {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.sig-canvas-wrapper {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    background: #ffffff;
    margin-bottom: 1rem;
    touch-action: none;
}

.sig-canvas {
    width: 100%;
    height: 180px;
    display: block;
    cursor: crosshair;
}

.btn-clear-sig {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-clear-sig:hover {
    background: #e2e8f0;
}

/* Terms and Submit */
.terms-card {
    background: #ffffff;
    padding: 1.5rem;
}

.global-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-top: 1rem;
    font-weight: 600;
}

.submit-box {
    margin-top: 1.5rem;
    text-align: center;
}

.btn-submit {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 400px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-submit:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.1rem;
    color: var(--secondary);
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #94a3b8;
}

.modal-body {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.6;
}

.modal-body ul {
    margin: 1rem 0 1rem 1.25rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-body code {
    background: #f1f5f9;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-weight: 700;
    color: var(--primary);
}

.modal-footer {
    margin-top: 1.25rem;
    text-align: right;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
}

.btn-download {
    display: inline-block;
    background: #0f172a;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    margin: 0.25rem;
    transition: background 0.2s;
}

.btn-download:hover {
    background: var(--primary);
}

/* Success & Error Cards */
.error-card, .success-card {
    text-align: center;
    padding: 3rem 1.5rem;
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.error-card h2, .success-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.res-summary-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-width: 400px;
    margin: 1.5rem auto;
    padding: 1rem;
    text-align: left;
    font-size: 0.9rem;
}

.downloads-section {
    margin-top: 2rem;
}

.downloads-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Home / Landing */
.home-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.home-wrapper {
    max-width: 560px;
    width: 100%;
}

.home-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.home-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.home-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
}

.home-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.home-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: left;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    gap: 0.75rem;
}

.info-icon {
    font-size: 1.5rem;
}

.info-item strong {
    display: block;
    font-size: 0.95rem;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.info-item p {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.home-admin-box {
    border-top: 1px solid #e2e8f0;
    padding-top: 1.25rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.home-admin-box span {
    font-size: 0.85rem;
    color: #64748b;
}

.home-footer {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Responsiveness */
@media (max-width: 640px) {
    .form-grid-3, .form-grid-2 {
        grid-template-columns: 1fr;
    }
    .checkin-header {
        padding: 0.75rem 0;
    }
    .brand-text h1 {
        font-size: 1.1rem;
    }
    .card {
        padding: 1.25rem;
    }
}
