/* ===========================
   EZStays Guest Scanner CSS
   Design Inspiration: visitor-kiosk
   =========================== */

:root {
    --color-warm: #f36f2f;
    --color-warm-100: #d6591f;
    --color-warm-200: #ff854a;
    --color-base: #FAFAFA;
    --color-white: #ffffff;
    --color-black-500: #282828;
    --color-black-400: #474545;
    --color-black-100: #898989;
    --color-black-light: #DCDCDC;
    --color-red-500: #FF0000;
    --color-green: #7AB716;
    --color-gradient: linear-gradient(135deg, #f36f2f 0%, #ff854a 100%);

    --radius-xs: 16px;
    --radius-sm: 8px;
    --radius-md: 24px;
    --radius-lg: 32px;

    --sp-4: 4px;
    --sp-8: 8px;
    --sp-12: 12px;
    --sp-16: 16px;
    --sp-20: 20px;
    --sp-24: 24px;
    --sp-32: 32px;
    --sp-48: 48px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-base);
    color: var(--color-black-500);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===========================
   Background Pattern
   =========================== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 10% 10%, rgba(243, 111, 47, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgba(214, 89, 31, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===========================
   Layout
   =========================== */
.kiosk-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-24);
    position: relative;
    z-index: 1;
}

.screen {
    display: none;
    width: 100%;
}

.screen.active {
    display: flex;
}

/* ===========================
   Card
   =========================== */
.kiosk-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--sp-48);
    max-width: 720px;
    width: 100%;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 10px 40px rgba(0, 0, 0, 0.08);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

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

/* ===========================
   Logo + Branding
   =========================== */
.logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.brand-logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

/* ===========================
   Typography
   =========================== */
.heading-xl {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-black-500);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.heading-lg {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-black-500);
    letter-spacing: -0.3px;
}

.body-text {
    font-size: 15px;
    color: var(--color-black-500);
    line-height: 1.6;
}

.body-text.gray {
    color: var(--color-black-100);
}

.body-text.bold {
    font-weight: 600;
}

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

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mt-10 {
    margin-top: 2.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* ===========================
   Divider
   =========================== */
.divider {
    border: none;
    border-top: 1px solid var(--color-black-light);
    margin: 32px 0 16px;
}

/* ===========================
   Step Indicator
   =========================== */
.step-indicator {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-black-light);
    transition: background 0.3s, width 0.3s;
}

.step-dot.active {
    background: var(--color-warm);
    width: 24px;
    border-radius: 4px;
}

/* ===========================
   Back Button
   =========================== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--color-black-100);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
    transition: color 0.2s;
    font-family: inherit;
}

.back-btn:hover {
    color: var(--color-black-500);
}

/* ===========================
   Search Input
   =========================== */
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 1.5px solid var(--color-black-light);
    border-radius: var(--radius-xs);
    background: var(--color-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 16px;
}

.search-input-wrap:focus-within {
    border-color: var(--color-warm);
    box-shadow: 0 0 0 3px rgba(255, 155, 76, 0.12);
}

.search-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--color-black-500);
    background: transparent;
    font-family: inherit;
}

.search-input::placeholder {
    color: #9A9A9A;
}

/* ===========================
   Search Results
   =========================== */
.search-results {
    border: 1px solid var(--color-black-light);
    border-radius: var(--radius-xs);
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
}

.student-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
    background: var(--color-white);
}

.student-result-item:last-child {
    border-bottom: none;
}

.student-result-item:hover {
    background: #fff9f6;
}

.avatar-sm {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.avatar-sm img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-info {
    flex: 1;
    min-width: 0;
}

.student-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-black-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-meta {
    font-size: 12px;
    color: var(--color-black-100);
    margin-top: 2px;
}

.select-arrow {
    color: var(--color-warm);
    flex-shrink: 0;
}

.search-empty {
    text-align: center;
    padding: 40px 20px;
}

.search-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

/* ===========================
   Search Spinner
   =========================== */
.search-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-black-light);
    border-top-color: var(--color-warm);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===========================
   Student Preview (step 3)
   =========================== */
.student-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff9f6;
    border: 1.5px solid rgba(243, 111, 47, 0.3);
    border-radius: var(--radius-xs);
    padding: 14px 18px;
    margin-bottom: 28px;
}

.student-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.student-avatar img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.verified-badge {
    margin-left: auto;
    background: rgba(122, 183, 22, 0.15);
    color: #5a8a10;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ===========================
   Form Inputs
   =========================== */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.flex-1 {
    flex: 1;
}

.form-row {
    display: flex;
    gap: 16px;
}

@media (max-width: 500px) {
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-black-500);
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1.5px solid var(--color-black-light);
    border-radius: var(--radius-xs);
    background: var(--color-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--color-warm);
    box-shadow: 0 0 0 3px rgba(255, 155, 76, 0.12);
}

.base-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--color-black-500);
    background: transparent;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.base-input::placeholder {
    color: #9A9A9A;
}

select.base-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-size: 16px;
}

select.base-input:focus {
    outline: none;
}

/* ── Custom Select Trigger ─────────────────────────────── */
.custom-select-trigger {
    flex: 1;
    font-size: 16px;
    font-family: inherit;
    color: #9A9A9A;
    background: transparent;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.custom-select-trigger.selected {
    color: var(--color-black-500);
    font-weight: 500;
}

/* ── Custom Bottom Sheet Dropdown ──────────────────────── */
.custom-select-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(2px);
}

.custom-select-panel {
    width: 100%;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 8px 0 32px;
    animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-handle {
    width: 40px;
    height: 4px;
    background: #E0E0E0;
    border-radius: 2px;
    margin: 12px auto 20px;
}

.custom-select-title {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 20px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.custom-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-size: 17px;
    font-family: inherit;
    font-weight: 500;
    color: var(--color-black-500);
    cursor: pointer;
    transition: background 0.15s;
}

.custom-select-option:hover,
.custom-select-option:active {
    background: #f9f9f9;
}

.custom-select-option.active-option {
    color: var(--color-warm);
}

.custom-select-option .check-icon {
    display: none;
}

.custom-select-option.active-option .check-icon {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all 0.2s;
    text-decoration: none;
}

.btn-xl {
    padding: 16px 28px;
    font-size: 17px;
}

.btn-lg {
    padding: 13px 24px;
    font-size: 15px;
}

.btn-gradient {
    background: var(--color-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(243, 111, 47, 0.3);
}

.btn-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(243, 111, 47, 0.4);
}

.btn-gradient:active {
    transform: translateY(0);
}

.btn-gradient:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--color-base);
    color: var(--color-black-500);
    border: 1.5px solid var(--color-black-light);
}

.btn-secondary:hover {
    background: #f0f0f0;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

/* ===========================
   Success / Error States
   =========================== */
.success-icon-wrap,
.error-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.success-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7AB716 0%, #5a8a10 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.error-circle,
.error-circle-static {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF4444 0%, #cc0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-circle {
    animation: popIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.pending-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f36f2f 0%, #d4591d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 20px rgba(243, 111, 47, 0.2);
}

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

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

.success-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    justify-content: center;
}

@media (min-width: 480px) {
    .success-actions {
        flex-direction: row;
        gap: 12px;
    }
}

.pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 155, 76, 0.08);
    color: var(--color-warm-100);
    border: 1.5px solid rgba(253, 111, 47, 0.2);
    border-radius: var(--radius-xs);
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.pending-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-warm);
    animation: pulse 1.4s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.spinner-xl {
    width: 64px;
    height: 64px;
    border: 4px solid var(--color-black-light);
    border-top-color: var(--color-warm);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 8px;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 600px) {
    .kiosk-card {
        padding: 28px 20px;
        border-radius: 24px;
    }

    .heading-xl {
        font-size: 1.5rem;
    }

    .heading-lg {
        font-size: 1.25rem;
    }

    .btn-xl {
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* ===========================
   Branding & Support
   =========================== */
.brand-logo-small {
    display: flex;
    justify-content: center;
}

.support-link {
    display: inline-block;
    color: var(--color-warm);
    font-weight: 700;
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.2s;
}

.support-link:hover {
    opacity: 0.8;
}

.border-t {
    border-top: 1.5px solid;
}

.border-gray-100 {
    border-color: #f3f4f6;
}

.pt-8 {
    padding-top: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}