:root {
    --bg-color: #F7F8FA;
    --surface-color: #FFFFFF;
    --border-color: #E9ECEF;
    --primary: #00A86B; /* Jade green */
    --primary-hover: #008B58; /* Darker jade */
    --text-main: #343A40;
    --text-muted: #868E96;
    --text-light: #CED4DA;
    --success: #00A86B;
    --danger: #FA5252;
    --warning: #FAB005;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Noto Sans KR', sans-serif; }
body { background-color: #E9ECEF; color: var(--text-main); display: flex; justify-content: center; min-height: 100vh; }
#app { width: 100%; max-width: 480px; height: 100vh; height: 100dvh; background: var(--bg-color); position: relative; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 0 25px rgba(0,0,0,0.05); }

.glass, .glass-card { background: var(--surface-color); border: 1px solid var(--border-color); box-shadow: 0 4px 12px rgba(0,0,0,0.02); border-radius: var(--radius-lg); }
.glass-card { padding: 20px; }
.bg-white { background: #fff !important; }

/* Auth Layout */
.auth-layout { background: var(--bg-color); height: 100vh; overflow-y: auto; display: block; padding: 0; }
.auth-box { width: 100%; max-width: 400px; margin: 0 auto; padding: 0 20px 20px; }

/* Original gradient header */
.auth-header-plain { background: linear-gradient(135deg, #33D197, #00A86B); padding: 40px 20px 35px; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; text-align: center; margin-bottom: -15px; }
.auth-header-plain h1 { font-size: 1.4rem; font-weight: 700; color: white; margin: 8px 0 4px; }
.auth-subtitle { font-size: 0.85rem; color: rgba(255,255,255,0.9); margin: 0; }
.auth-logo { margin-bottom: 12px; margin-top: 0; display: flex; justify-content: center; }

/* Step Dots */
.step-dots { display: flex; justify-content: center; gap: 10px; margin: 14px 0 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); transition: background 0.3s; }
.dot.active { background: white; }

/* Auth Card (original style) */
.auth-card { background: var(--surface-color); padding: 20px; border-radius: var(--radius-lg); box-shadow: 0 8px 30px rgba(0,0,0,0.08); text-align: left; border: 1px solid var(--border-color); position: relative; z-index: 10; margin-top: -15px; }

.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 0.8rem; font-weight: 600; color: #495057; margin-bottom: 8px; }
.input-wrapper { display: flex; align-items: center; border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 0 14px; background: #FFFFFF; transition: var(--transition); height: 48px; }
.input-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,168,107,0.15); }
.input-wrapper i { color: var(--text-muted); font-size: 1.2rem; flex-shrink: 0; }
.input-wrapper input { border: none; outline: none; padding: 14px 10px; width: 100%; font-size: 0.95rem; background: transparent; color: var(--text-main); height: 100%; }
.input-wrapper input::placeholder { color: var(--text-light); }
.input-wrapper select { border: none; outline: none; padding: 0 6px; width: 100%; font-size: 0.95rem; background: transparent; color: var(--text-main); height: 100%; appearance: none; cursor: pointer; }
.action-icon { margin-left: auto; font-size: 1.2rem; }

/* Input hint text */
.input-hint { font-size: 0.75rem; color: var(--text-muted); margin: 6px 0 0; line-height: 1.4; }

/* Select with chevron arrow */
.select-wrapper { position: relative; }
.select-wrapper::after { content: '›'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%) rotate(90deg); font-size: 1.2rem; color: var(--text-muted); pointer-events: none; }

/* Breed Autocomplete */
.breed-autocomplete-wrap { position: relative; }
.breed-suggestions { list-style: none; margin: 0; padding: 0; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 100; max-height: 220px; overflow-y: auto; display: none; }
.breed-suggestions.open { display: block; }
.breed-suggestions li { padding: 11px 14px; font-size: 0.9rem; color: var(--text-main); cursor: pointer; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #F5F5F5; transition: background 0.15s; }
.breed-suggestions li:last-child { border-bottom: none; }
.breed-suggestions li:hover, .breed-suggestions li.active { background: #F0FBF6; color: var(--primary); }
.breed-suggestions li .breed-icon { color: var(--primary); flex-shrink: 0; }
.breed-suggestions li .breed-match { font-weight: 700; color: var(--primary); }
.breed-suggestions .no-result { color: var(--text-muted); font-style: italic; cursor: default; }
.breed-suggestions .no-result:hover { background: transparent; }

/* Age row (년/개월 side by side) */
.age-row { display: flex; gap: 12px; }
.age-row .input-group { flex: 1; }
.flex-1 { flex: 1; }

/* Privacy checkbox row */
.privacy-check-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.privacy-check-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.privacy-check-row label { font-size: 0.85rem; color: #495057; cursor: pointer; line-height: 1.3; }

/* Button row for prev/next */
.btn-row { display: flex; gap: 10px; margin-top: 4px; }
.btn-row .secondary-btn { flex: 1; }
.btn-row .primary-btn { flex: 1; }

/* Step panel visibility */
.signup-step { display: block; }
.signup-step.hidden { display: none !important; }

/* Auth footer */
.auth-footer { text-align: center; }

/* Social Login Buttons */
.divider-text { display: flex; align-items: center; text-align: center; color: var(--text-muted); font-size: 0.8rem; margin: 20px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; border-bottom: 1px solid var(--border-color); }
.divider-text::before { margin-right: 10px; }
.divider-text::after { margin-left: 10px; }

.social-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 600; margin-bottom: 10px; cursor: pointer; transition: opacity 0.2s; position: relative; border: none; }
.social-btn:hover { opacity: 0.9; }
.social-btn.btn-kakao { background: #FEE500; color: #000000; }
.social-btn.btn-naver { background: #03C75A; color: #FFFFFF; }
.social-btn img { position: absolute; left: 16px; width: 20px; height: 20px; }

/* Dashboard Content */
#main-content { flex: 1; overflow-y: auto; padding-bottom: 90px; scrollbar-width: none; background: #F7F8FA; }
#main-content::-webkit-scrollbar { display: none; }
.view { display: none; animation: fadeIn 0.3s ease forwards; }
.view.active { display: block; }

/* New Home Design (Centered QR & Big TAIL45) */
.home-top-banner {
    background: linear-gradient(135deg, #33D197, #00A86B);
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    padding-bottom: 20px;
}
.brand-text {
    font-size: 2.8rem; /* Huge font */
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 5px;
}
.subtitle-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
}

.p-20 { padding: 20px; }
.home-content-wrapper { position: relative; z-index: 10; padding: 0 24px; }

/* The Central QR Container */
.qr-center-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: -60px; /* Overlaps with banner */
    box-shadow: 0 12px 35px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.03);
}
.qr-wrapper {
    background: white;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
}

/* 2 Action Cards */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.action-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.03);
    cursor: pointer;
    border: 1px solid #E9ECEF;
    transition: var(--transition);
}
.action-card:hover { border-color: var(--primary); transform: translateY(-3px); }

/* Typography */
h1 { font-size: 1.5rem; margin-bottom: 4px; }
h2 { font-size: 1.3rem; margin-bottom: 8px; }
h3 { font-size: 1.1rem; }
.text-gray { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 30px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 10px; } .mb-2 { margin-bottom: 20px; } .mb-3 { margin-bottom: 30px; }
.mr-1 { margin-right: 8px; }
.font-bold { font-weight: 700; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-align-center { display: flex; align-items: center; }
.flex-end { display: flex; justify-content: flex-end; }
.full-width { width: 100%; }
.text-center { text-align: center; }
.text-huge { font-size: 8rem; }
.pointer { cursor: pointer; }
.bg-light { background: var(--surface-light); }
.border-radius { border-radius: var(--radius-sm); }
.p-1 { padding: 8px; }
.p-0 { padding: 0 !important; }
.padding-x { padding: 16px 20px !important; }
.border-none { border-bottom: none !important; }

/* Buttons */
button { cursor: pointer; border: none; outline: none; font-weight: 600; border-radius: var(--radius-sm); transition: var(--transition); }
.primary-btn { background: var(--primary); color: white; padding: 14px 24px; font-size: 1rem; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,168,107,0.2); }
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.secondary-btn { background: var(--surface-color); color: var(--text-main); padding: 12px 20px; border: 1px solid var(--border-color); border-radius: 8px; }
.secondary-btn:hover { background: #F8F9FA; }

/* Cards */
.basic-card { background: var(--surface-color); padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.highlight-border { border-color: var(--primary) !important; border-width: 2px !important; background: rgba(0,168,107,0.02) !important; }

/* Ticket Type Selection Cards */
.ticket-type-card { display: flex; align-items: center; gap: 16px; background: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 12px; cursor: pointer; transition: var(--transition); box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.ticket-type-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,168,107,0.1); }
.ticket-type-card:active { transform: translateY(0); }
.ticket-type-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ticket-type-info { flex: 1; min-width: 0; }

/* Reservation System */
.rsv-section { margin-bottom: 20px; }
.rsv-label { display: flex; align-items: center; font-size: 0.9rem; font-weight: 700; color: var(--text-main); margin-bottom: 10px; }
.rsv-card { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }

/* Calendar */
.rsv-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.rsv-cal-nav { background: none; border: none; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-main); transition: var(--transition); font-size: 1rem; }
.rsv-cal-nav:hover { background: var(--bg-color); }
.rsv-cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; margin-bottom: 8px; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.rsv-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.rsv-cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.88rem; font-weight: 500; cursor: pointer; transition: var(--transition); color: var(--text-main); position: relative; border: 2px solid transparent; }
.rsv-cal-day:hover:not(.disabled):not(.empty) { background: rgba(0,168,107,0.08); }
.rsv-cal-day.today { font-weight: 800; color: var(--primary); }
.rsv-cal-day.today::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.rsv-cal-day.selected { background: var(--primary); color: #fff; font-weight: 700; border-color: var(--primary); }
.rsv-cal-day.selected.today::after { background: #fff; }
.rsv-cal-day.disabled { color: #D5D8DC; cursor: default; pointer-events: none; }
.rsv-cal-day.empty { cursor: default; pointer-events: none; }
.rsv-cal-day.sunday { color: var(--danger); }
.rsv-cal-day.sunday.disabled { color: rgba(250,82,82,0.3); }
.rsv-cal-day.saturday { color: #3B82F6; }
.rsv-cal-day.saturday.disabled { color: rgba(59,130,246,0.3); }

/* Time Slots */
.rsv-time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rsv-time-slot { padding: 12px 4px; text-align: center; border-radius: 10px; border: 1.5px solid var(--border-color); font-size: 0.88rem; font-weight: 600; color: var(--text-main); cursor: pointer; transition: var(--transition); background: #fff; }
.rsv-time-slot:hover:not(.booked):not(.disabled) { border-color: var(--primary); background: rgba(0,168,107,0.04); }
.rsv-time-slot.selected { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 700; }
.rsv-time-slot.booked { background: #FFF5F5; border-color: #FED7D7; color: #E53E3E; cursor: default; pointer-events: none; position: relative; }
.rsv-time-slot.booked::after { content: '예약됨'; display: block; font-size: 0.65rem; font-weight: 500; margin-top: 1px; opacity: 0.8; }
.rsv-time-slot.disabled { color: #D5D8DC; background: #FAFAFA; cursor: default; pointer-events: none; border-color: #F0F0F0; }

/* Duration */
.rsv-duration-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rsv-duration-chip { padding: 14px 4px; text-align: center; border-radius: 10px; border: 1.5px solid var(--border-color); font-size: 0.88rem; font-weight: 600; color: var(--text-main); cursor: pointer; transition: var(--transition); background: #fff; }
.rsv-duration-chip:hover { border-color: var(--primary); }
.rsv-duration-chip.selected { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 700; }
.rsv-duration-call { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; background: #FFFBEB; border-color: #FDE68A; color: #92400E; font-size: 0.88rem; }
.rsv-duration-call:hover { border-color: #F59E0B; background: #FEF3C7; }

/* People Counter */
.rsv-counter-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.rsv-counter-divider { height: 1px; background: var(--border-color); margin: 12px 0; }
.rsv-counter { display: flex; align-items: center; gap: 16px; }
.rsv-counter-btn { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border-color); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); color: var(--text-main); font-size: 0.85rem; }
.rsv-counter-btn:hover { border-color: var(--primary); color: var(--primary); }
.rsv-counter-btn:active { background: rgba(0,168,107,0.05); }
.rsv-counter-val { font-size: 1.15rem; font-weight: 700; min-width: 24px; text-align: center; color: var(--text-main); }

/* Bottom Bar */
.rsv-bottom-bar { position: absolute; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border-color); padding: 12px 20px; padding-bottom: max(12px, env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0,0,0,0.06); z-index: 50; }
.rsv-summary { text-align: center; margin-bottom: 10px; color: var(--text-main); }

/* Terms Agree */
.terms-check-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; margin-bottom: 8px; }
.terms-check-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; margin: 0; }
.terms-check-label { font-size: 0.82rem; font-weight: 600; color: var(--text-main); line-height: 1.3; }
.primary-btn.disabled { background: #D5D8DC; cursor: not-allowed; pointer-events: none; box-shadow: none; }

/* Yard Status Cards */
.yard-card { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 14px; margin-bottom: 10px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.02); }
.yard-card-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.yard-badge { font-size: 0.78rem; font-weight: 700; padding: 5px 12px; border-radius: 8px; flex-shrink: 0; white-space: nowrap; }
.yard-total { margin-left: auto; font-size: 0.85rem; font-weight: 700; color: var(--primary); }
.yard-card-body { padding: 0 16px 12px; }
.yard-size-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.yard-pulse { width: 8px; height: 8px; border-radius: 50%; background: #E53E3E; animation: pulse-dot 1.5s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

/* Day Pass */
.daypass-card { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 32px 20px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.daypass-icon { width: 72px; height: 72px; border-radius: 20px; background: linear-gradient(135deg, #FAB005, #E09800); display: flex; align-items: center; justify-content: center; margin: 0 auto; box-shadow: 0 6px 16px rgba(250,176,5,0.3); }

/* Pet Check Row */
.dp-pet-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; cursor: pointer; transition: var(--transition); }
.dp-pet-row + .dp-pet-row { border-top: 1px solid var(--border-color); }
.dp-pet-check { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--border-color); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: var(--transition); background: #fff; }
.dp-pet-row.checked .dp-pet-check { background: var(--primary); border-color: var(--primary); }
.dp-pet-avatar { width: 44px; height: 44px; border-radius: 50%; background: #D1FAE5; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dp-pet-row.checked .dp-pet-avatar { background: #A7F3D0; }
.dp-pet-info { flex: 1; min-width: 0; }

/* QR View (Mypet generic) */
.pet-selector { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.pet-chip { padding: 10px 18px; background: var(--surface-color); border-radius: 24px; white-space: nowrap; cursor: pointer; font-size: 0.9rem; font-weight: 600; border: 1px solid var(--border-color); transition: var(--transition); color: var(--text-muted); }
.pet-chip.selected { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 12px rgba(0, 168, 107, 0.3); }

/* Timer Display */
.timer-large { font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; color: var(--text-main); }
.timer-large.danger { color: var(--danger); animation: pulse 1s infinite alternate; }
.timer-large.warning { color: var(--warning); }
.progress-bar { width: 100%; height: 6px; background: #E9ECEF; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); width: 100%; transition: width 1s linear; }
.progress-fill.danger { background: var(--danger); }
.progress-fill.warning { background: var(--warning); }

/* Profile View */
.profile-header { display: flex; align-items: center; flex-direction: column; gap: 12px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.bg-primary { background: var(--primary); }
.menu-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background 0.2s; }
.menu-item:hover { background: rgba(0,0,0,0.02); }

/* Bottom Nav */
.bottom-nav { position: absolute; bottom: 0; width: 100%; display: flex; justify-content: space-around; padding: 12px 0 24px 0; background: var(--surface-color); border-top: 1px solid var(--border-color); z-index: 40; }
.nav-item { display: flex; flex-direction: column; align-items: center; color: var(--text-light); cursor: pointer; transition: var(--transition); width: 25%; }
.nav-item i { font-size: 1.5rem; margin-bottom: 4px; transition: 0.2s; }
.nav-item span { font-size: 0.7rem; font-weight: 500; }
.nav-item.active { color: var(--primary); }
.nav-item.active i { animation: bounce 0.4s ease; }

/* SOS floating button */
.sos-btn { position: absolute; bottom: 90px; right: 20px; background: var(--danger); color: white; width: 56px; height: 56px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(250, 82, 82, 0.4); z-index: 50; }
.sos-btn i { font-size: 1.5rem; margin-bottom: 2px; }
.sos-btn span { font-size: 0.6rem; font-weight: 700; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 100; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s; backdrop-filter: blur(2px); }
.modal-box { width: 90%; max-width: 320px; text-align: left; background: var(--surface-color); }
.hidden { display: none !important; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes pulse { 0% { opacity: 1; } 100% { opacity: 0.5; } }
