﻿/* ============================================================
   Эко-деревня «Кривополянье» — Telegram Mini App
   Design System: TelegramUI + MagicUI + Eco Nature Theme
   ============================================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
    /* Telegram theme (defaults, overridden by TMA runtime) */
    --tg-theme-bg-color: #F8F5F0;
    --tg-theme-text-color: #1A1A1A;
    --tg-theme-hint-color: #8A8A8E;
    --tg-theme-link-color: #2D5A27;
    --tg-theme-button-color: #2D5A27;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #EFEBE5;

    /* Eco palette */
    --eco-green: #2D5A27;
    --eco-green-light: #4a8c3f;
    --eco-green-pale: #87A96B;
    --eco-green-bg: rgba(45, 90, 39, 0.08);
    --eco-green-rgb: 45, 90, 39;
    --eco-warm: #D4A574;
    --eco-warm-rgb: 212, 165, 116;
    --eco-warm-light: #E8C9A6;
    --eco-cream: #FFF8F0;
    --eco-brown: #6B5344;
    --eco-error: #D32F2F;
    --eco-success: #388E3C;

    /* Layout */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --radius-full: 100px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-glow: 0 4px 24px rgba(45, 90, 39, 0.2);
    --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    --z-link-sheet: 900;
}

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

/* --- Base --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   APP LOADER
   ============================================================ */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-theme-bg-color);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.app-loader-content {
    text-align: center;
    animation: loaderAppear 0.6s ease both;
}
@keyframes loaderAppear {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.app-loader-icon {
    font-size: 56px;
    margin-bottom: 12px;
    animation: loaderFloat 2s ease-in-out infinite;
}
@keyframes loaderFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.app-loader-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--eco-green);
    letter-spacing: -0.5px;
    margin-bottom: 20px;
}
.app-loader-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--tg-theme-secondary-bg-color);
    border-top-color: var(--eco-green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
}
/* MAX fallback MainButton floats above the tab bar — add clearance so it
   never covers the last fields/content (Telegram uses a native button). */
html.mainbutton-visible .app {
    padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px));
}

/* ============================================================
   ANIMATIONS (MagicUI: BlurFade, BorderBeam, Shimmer)
   ============================================================ */
@keyframes blurFadeIn {
    from { opacity: 0; filter: blur(8px); transform: translateY(12px); }
    to { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@keyframes blurFadeUp {
    from { opacity: 0; filter: blur(4px); transform: translateY(20px); }
    to { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes borderBeamRotate {
    to { --beam-angle: 360deg; }
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--eco-green-rgb), 0.25); }
    50% { box-shadow: 0 0 0 8px rgba(var(--eco-green-rgb), 0); }
}
@keyframes checkBounce {
    from { transform: scale(0) rotate(-20deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes dotPop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}
@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}
@keyframes shineSweep {
    0% { background-position: 200% 200%; }
    50% { background-position: 0% 0%; }
    100% { background-position: 200% 200%; }
}

@property --beam-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ============================================================
   TAB BAR (TelegramUI-inspired)
   ============================================================ */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--tg-theme-bg-color);
    border-top: 0.5px solid rgba(0,0,0,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.tab-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--tg-theme-hint-color);
    cursor: pointer;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    padding: 6px 0;
}
.tab-bar-item.active {
    color: var(--eco-green);
}
.tab-bar-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 32px;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--eco-green);
    transition: transform var(--transition);
}
.tab-bar-item.active::before {
    transform: translateX(-50%) scaleX(1);
}
.tab-bar-icon {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
}
.tab-bar-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

/* ============================================================
   TAB CONTENT
   ============================================================ */
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* ============================================================
   STEPS (Booking Flow)
   ============================================================ */
.step {
    display: none;
}
.step.active {
    display: block;
    animation: blurFadeIn 0.35s ease both;
}

/* Step header */
.step-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 16px;
}
.step-header-icon {
    font-size: 32px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--eco-green-bg);
}
.step-header-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.2;
}
.step-header-subtitle {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin-top: 2px;
}

/* ============================================================
   HERO BANNER (Dates step)
   ============================================================ */
.hero-banner {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, #1a3a1a 0%, #2D5A27 30%, #4a8c3f 60%, #87A96B 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    overflow: hidden;
    margin: 0;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(255,248,240,0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(135,169,107,0.2) 0%, transparent 50%);
}
.hero-overlay::before {
    content: '🌿🌾🍃🌱';
    position: absolute;
    font-size: 40px;
    top: 10px;
    right: 8px;
    opacity: 0.12;
    letter-spacing: 8px;
    transform: rotate(-15deg);
}
.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #fff;
    padding: 0 20px;
}
.hero-emoji {
    font-size: 44px;
    margin-bottom: 8px;
    animation: loaderFloat 3s ease-in-out infinite;
}
.hero-title {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -1px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.2);
    line-height: 1.1;
}
.hero-subtitle {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 6px;
    letter-spacing: 0.3px;
}

/* ============================================================
   SECTIONS (TelegramUI-inspired)
   ============================================================ */
.section {
    padding: 0 16px 16px;
}
.section-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--tg-theme-hint-color);
    padding: 20px 4px 10px;
}

/* ============================================================
   FORMS (TelegramUI-inspired)
   ============================================================ */
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--tg-theme-hint-color);
    margin-bottom: 6px;
    padding-left: 2px;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    outline: none;
    -webkit-appearance: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.form-group input:focus {
    border-color: var(--eco-green);
    background: var(--tg-theme-bg-color);
    box-shadow: 0 0 0 3px rgba(var(--eco-green-rgb), 0.1);
}
.form-group input.error {
    border-color: var(--eco-error);
    box-shadow: 0 0 0 3px rgba(211,47,47,0.1);
    animation: shake 0.4s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}
.form-group input::placeholder {
    color: var(--tg-theme-hint-color);
    opacity: 0.6;
}
.dates-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ============================================================
   COUNTER
   ============================================================ */
.counter-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    border: 1.5px solid rgba(0,0,0,0.04);
    margin-bottom: 12px;
}
.counter-label {
    font-size: 16px;
    font-weight: 600;
}
.counter {
    display: flex;
    align-items: center;
    gap: 16px;
}
.counter-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid rgba(var(--eco-green-rgb), 0.25);
    background: var(--tg-theme-bg-color);
    color: var(--eco-green);
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}
.counter-btn:active {
    transform: scale(0.88);
    background: rgba(var(--eco-green-rgb), 0.08);
    border-color: var(--eco-green);
}
.counter-value {
    font-size: 20px;
    font-weight: 800;
    min-width: 28px;
    text-align: center;
}

/* ============================================================
   CATEGORY CARDS
   ============================================================ */
.category-card {
    position: relative;
    background: var(--tg-theme-bg-color);
    border-radius: var(--radius-lg);
    margin: 0 16px 14px;
    cursor: pointer;
    border: 1.5px solid rgba(0,0,0,0.06);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    -webkit-tap-highlight-color: transparent;
    animation: blurFadeUp 0.4s ease both;
}
.category-card:nth-child(1) { animation-delay: 0s; }
.category-card:nth-child(2) { animation-delay: 0.06s; }
.category-card:nth-child(3) { animation-delay: 0.12s; }
.category-card:nth-child(4) { animation-delay: 0.18s; }
.category-card:nth-child(5) { animation-delay: 0.24s; }
.category-card:active {
    transform: scale(0.98);
}

.category-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: var(--tg-theme-secondary-bg-color);
}
.category-card-image-placeholder {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, rgba(var(--eco-green-rgb), 0.08), rgba(var(--eco-green-rgb), 0.03));
}
.category-card-body {
    padding: 16px;
}
.category-card-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}
.category-card-desc {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.category-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.category-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.category-card-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--eco-green);
}
.category-card-price-label {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1px;
}
.badge-green {
    background: rgba(var(--eco-green-rgb), 0.1);
    color: var(--eco-green);
}
.badge-warm {
    background: rgba(var(--eco-warm-rgb), 0.15);
    color: #8B6914;
}
.badge-secondary {
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-hint-color);
}
.badge-promo {
    background: #FF6B35;
    color: #fff;
}
.badge-discount {
    background: rgba(56, 142, 60, 0.12);
    color: var(--eco-success);
}
.badge-status-active {
    background: rgba(56, 142, 60, 0.1);
    color: var(--eco-success);
}
.badge-status-cancelled {
    background: rgba(211, 47, 47, 0.1);
    color: var(--eco-error);
}

/* ============================================================
   ROOM VARIANT CARDS
   ============================================================ */
.room-card {
    position: relative;
    background: var(--tg-theme-bg-color);
    border-radius: var(--radius-lg);
    margin: 0 16px 14px;
    cursor: pointer;
    border: 1.5px solid rgba(0,0,0,0.06);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    -webkit-tap-highlight-color: transparent;
    animation: blurFadeUp 0.4s ease both;
}
.room-card:nth-child(1) { animation-delay: 0s; }
.room-card:nth-child(2) { animation-delay: 0.06s; }
.room-card:nth-child(3) { animation-delay: 0.08s; }
.room-card:active { transform: scale(0.98); }

/* BorderBeam on selected */
.room-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1.5px;
    background: conic-gradient(from var(--beam-angle), transparent 0deg, rgba(var(--eco-green-rgb), 0.9) 60deg, transparent 120deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}
.room-card.selected::before {
    opacity: 1;
    animation: borderBeamRotate 2.5s linear infinite;
}
.room-card.selected {
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}
.room-card > * { position: relative; z-index: 1; }

.room-card-body {
    padding: 16px;
}
.room-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.room-card-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    flex: 1;
    padding-right: 8px;
}
.room-card-price-block {
    text-align: right;
    flex-shrink: 0;
}
.room-card-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--eco-green);
    white-space: nowrap;
}
.room-card-price-old {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    text-decoration: line-through;
}
.room-card-price-label {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    margin-top: 2px;
}
.room-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.room-card-info {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    line-height: 1.5;
}
.room-card-tariff {
    font-size: 13px;
    color: var(--eco-green-pale);
    font-weight: 500;
    margin-top: 2px;
}

/* ============================================================
   ROOM DETAIL VIEW
   ============================================================ */
.room-detail {
    animation: blurFadeIn 0.35s ease both;
}
.room-detail-carousel {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
    background: var(--tg-theme-secondary-bg-color);
}
.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}
.carousel-slide {
    min-width: 100%;
    height: 100%;
}
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.carousel-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    background: linear-gradient(135deg, rgba(var(--eco-green-rgb), 0.08), rgba(var(--eco-green-rgb), 0.03));
}
.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
}
.carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    padding: 0;
}
.carousel-dot.active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
}
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast), opacity var(--transition-fast);
    padding: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.carousel-arrow:active {
    background: rgba(0,0,0,0.6);
    transform: translateY(-50%) scale(0.92);
}
.carousel-arrow-prev {
    left: 8px;
}
.carousel-arrow-next {
    right: 8px;
}
.carousel-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    z-index: 5;
    backdrop-filter: blur(8px);
}

.room-detail-content {
    padding: 20px 16px;
}
.room-detail-name {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    line-height: 1.2;
}
.room-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.room-detail-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--eco-green-bg);
    border-radius: var(--radius-md);
}
.room-detail-price {
    font-size: 26px;
    font-weight: 900;
    color: var(--eco-green);
}
.room-detail-price-old {
    font-size: 15px;
    color: var(--tg-theme-hint-color);
    text-decoration: line-through;
}
.room-detail-price-nights {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin-left: auto;
}
.room-detail-desc {
    font-size: 15px;
    line-height: 1.65;
    color: var(--tg-theme-text-color);
    margin-bottom: 16px;
}
.room-detail-desc p {
    margin-bottom: 8px;
}
.room-detail-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.room-spec {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-sm);
}
.room-spec-icon {
    font-size: 20px;
}
.room-spec-text {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
}
.room-spec-text small {
    display: block;
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    font-weight: 400;
}

/* Select button at bottom of detail */
.room-detail-action {
    padding: 16px;
    position: sticky;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, var(--tg-theme-bg-color) 60%, transparent);
    z-index: 10;
}
.btn-select-room {
    width: 100%;
    padding: 16px;
    background: var(--eco-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition);
    box-shadow: var(--shadow-glow);
}
.btn-select-room:active {
    transform: scale(0.97);
}
/* Shimmer effect */
.btn-select-room::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmerBtn 2.5s ease infinite;
}
@keyframes shimmerBtn {
    0% { left: -60%; }
    100% { left: 160%; }
}

/* ============================================================
   PAYMENT OPTIONS
   ============================================================ */
.payment-option {
    display: flex;
    align-items: center;
    padding: 16px;
    margin: 0 16px 10px;
    background: var(--tg-theme-bg-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    border: 1.5px solid rgba(0,0,0,0.06);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}
.payment-option:active { transform: scale(0.98); }
.payment-option::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, transparent 20%, rgba(var(--eco-green-rgb), 0.1) 50%, transparent 80%);
    background-size: 200% 200%;
    opacity: 0;
    transition: opacity 0.3s;
}
.payment-option.selected::after {
    opacity: 1;
    animation: shineSweep 2s ease-in-out infinite;
}
.payment-option.selected {
    border-color: var(--eco-green);
    box-shadow: 0 4px 20px rgba(var(--eco-green-rgb), 0.15);
}
.payment-option-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.12);
    margin-right: 14px;
    flex-shrink: 0;
    position: relative;
    transition: border-color var(--transition);
    z-index: 1;
}
.payment-option.selected .payment-option-radio {
    border-color: var(--eco-green);
}
.payment-option.selected .payment-option-radio::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--eco-green);
    animation: dotPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.payment-option-content {
    z-index: 1;
    position: relative;
}
.payment-option-name {
    font-size: 15px;
    font-weight: 600;
}
.payment-option-desc {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-top: 2px;
}

/* ============================================================
   SUMMARY CARD (AnimatedGradientText top bar)
   ============================================================ */
.summary-card {
    background: var(--tg-theme-bg-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin: 0 16px 14px;
    box-shadow: var(--shadow-md);
    border: 1.5px solid rgba(0,0,0,0.05);
    overflow: hidden;
    position: relative;
    animation: blurFadeUp 0.4s ease both;
}
.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--eco-green), var(--eco-warm), var(--eco-green-pale), var(--eco-green));
    background-size: 200% 100%;
    animation: gradientShift 3s linear infinite;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.summary-row:last-of-type { border-bottom: none; }
.summary-row-label {
    color: var(--tg-theme-hint-color);
    font-size: 13px;
}
.summary-row-value {
    font-weight: 600;
    text-align: right;
    max-width: 60%;
}
.summary-total {
    font-size: 24px;
    font-weight: 900;
    color: var(--eco-green);
    text-align: right;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1.5px solid rgba(var(--eco-green-rgb), 0.12);
    letter-spacing: -0.5px;
}

/* ============================================================
   SUCCESS RESULT
   ============================================================ */
.result-success {
    text-align: center;
    padding: 48px 24px 32px;
    animation: blurFadeIn 0.5s ease both;
}
.result-success .checkmark {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
    animation: checkBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.result-success h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}
.result-booking-code {
    display: inline-block;
    background: var(--eco-green-bg);
    color: var(--eco-green);
    font-size: 16px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    margin: 10px 0 16px;
    letter-spacing: 0.5px;
}
.result-success p {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    line-height: 1.5;
    margin-bottom: 4px;
}
.result-success a.btn-payment {
    display: inline-block;
    position: relative;
    margin-top: 20px;
    padding: 16px 32px;
    background: var(--eco-green);
    color: #fff;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
    transition: transform var(--transition-fast);
}
.result-success a.btn-payment:active {
    transform: scale(0.96);
}
.result-success a.btn-payment::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmerBtn 2.2s ease infinite;
}
.btn-back-home {
    display: inline-block;
    margin-top: 24px;
    padding: 14px 32px;
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    border: none;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}
.btn-back-home:active {
    transform: scale(0.96);
    opacity: 0.8;
}

/* ============================================================
   LOADING / SKELETON
   ============================================================ */
.loading-container {
    padding: 16px;
}
.skeleton-card {
    height: 160px;
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
    background: linear-gradient(90deg, var(--tg-theme-secondary-bg-color) 25%, rgba(0,0,0,0.04) 50%, var(--tg-theme-secondary-bg-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
}
.skeleton-card.short {
    height: 72px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    animation: blurFadeIn 0.5s ease both;
}
.empty-state-icon {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.6;
}
.empty-state-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}
.empty-state-hint {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

/* ============================================================
   TAB PAGE HEADERS
   ============================================================ */
.tab-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 16px;
}
.tab-page-icon {
    font-size: 28px;
}
.tab-page-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

/* ============================================================
   MY BOOKINGS — CARDS
   ============================================================ */
.booking-card {
    background: var(--tg-theme-bg-color);
    border-radius: var(--radius-lg);
    margin: 0 16px 14px;
    padding: 0;
    box-shadow: var(--shadow-md);
    border: 1.5px solid rgba(0,0,0,0.05);
    animation: blurFadeUp 0.4s ease both;
    position: relative;
    overflow: hidden;
}

/* — Header — */
.booking-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 16px 12px;
    gap: 10px;
}
.booking-card-title-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.booking-card-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
}
.booking-card-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.2px;
}
.booking-card-hotel {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-top: 2px;
    line-height: 1.3;
}
.booking-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.booking-card-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--tg-theme-hint-color);
    background: var(--tg-theme-secondary-bg-color);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

/* — Status — */
.booking-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.2px;
    text-transform: uppercase;
}
.booking-status-active {
    background: rgba(56, 142, 60, 0.1);
    color: var(--eco-success);
}
.booking-status-cancelled {
    background: rgba(211, 47, 47, 0.08);
    color: var(--eco-error);
}

/* — Dates row — */
.booking-card-dates {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin: 0 16px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-md);
}
.booking-card-date {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.booking-card-date-label {
    font-size: 10px;
    color: var(--tg-theme-hint-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.booking-card-date-value {
    font-size: 14px;
    font-weight: 700;
}
.booking-card-date-arrow {
    font-size: 16px;
    color: var(--tg-theme-hint-color);
    margin: 12px 2px 0;
}
.booking-nights {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--eco-green);
    background: var(--eco-green-bg);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    align-self: center;
}

/* — Guest info — */
.booking-card-guest {
    padding: 12px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.booking-card-guest-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--tg-theme-text-color);
}
.booking-card-guest-icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

/* — Footer — */
.booking-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    margin-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.04);
}
.booking-card-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--eco-green);
    letter-spacing: -0.3px;
}
.booking-card-actions {
    display: flex;
    gap: 8px;
}
.btn-booking-action {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}
.btn-booking-action:active { transform: scale(0.94); }
.btn-booking-cancel {
    background: rgba(211, 47, 47, 0.08);
    color: var(--eco-error);
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-hero {
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, #1a3a1a 0%, #2D5A27 25%, #4a8c3f 55%, #87A96B 85%, #b5cfa0 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    overflow: hidden;
}
.about-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 70%, rgba(255,248,240,0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 30%, rgba(212,165,116,0.15) 0%, transparent 50%);
}
.about-hero-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.2));
}
.about-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #fff;
}
.about-hero-badge {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    backdrop-filter: blur(8px);
}
.about-hero-title {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -1px;
    text-shadow: 0 2px 16px rgba(0,0,0,0.2);
    line-height: 1.1;
}
.about-hero-location {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 8px;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px;
    margin-top: -30px;
    position: relative;
    z-index: 5;
}
.about-feature-card {
    background: var(--tg-theme-bg-color);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.04);
    animation: blurFadeUp 0.4s ease both;
}
.about-feature-card:nth-child(1) { animation-delay: 0.05s; }
.about-feature-card:nth-child(2) { animation-delay: 0.1s; }
.about-feature-card:nth-child(3) { animation-delay: 0.15s; }
.about-feature-card:nth-child(4) { animation-delay: 0.2s; }
.about-feature-icon {
    font-size: 32px;
    margin-bottom: 6px;
}
.about-feature-title {
    font-size: 14px;
    font-weight: 700;
}
.about-feature-desc {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    margin-top: 2px;
}

.about-section {
    margin-bottom: 4px;
}
.about-text p {
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 12px;
    color: var(--tg-theme-text-color);
}
.about-text p:last-child { margin-bottom: 0; }

.about-info-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.about-info-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.about-info-item:last-child { border-bottom: none; }
.about-info-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--eco-green-bg);
    flex-shrink: 0;
}
.about-info-label {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 1px;
}
.about-info-value {
    font-size: 15px;
    font-weight: 600;
}

/* Room types in About */
.about-room-type {
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    animation: blurFadeUp 0.35s ease both;
}
.about-room-type:last-child { border-bottom: none; }
.about-room-type-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}
.about-room-type-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.about-room-type-comment {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin-top: 4px;
    line-height: 1.4;
}

/* CTA */
.about-cta {
    text-align: center;
    padding: 32px 20px 24px;
}
.about-cta-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--tg-theme-text-color);
}
.btn-cta {
    display: inline-block;
    padding: 16px 36px;
    background: var(--eco-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}
.btn-cta:active { transform: scale(0.96); }
.btn-cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: shimmerBtn 2.5s ease infinite;
}

/* ============================================================
   INLINE LOADING SPINNER
   ============================================================ */
.loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.loading-inline .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--tg-theme-secondary-bg-color);
    border-top-color: var(--eco-green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ============================================================
   ACCOUNT LINK
   ============================================================ */
.link-sheet {
    position: fixed;
    inset: 0;
    z-index: var(--z-link-sheet);
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: var(--tg-theme-bg-color);
    animation: linkSheetIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.link-sheet[hidden] { display: none; }
@keyframes linkSheetIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
.link-sheet-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
}
.link-back {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--tg-theme-text-color);
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.link-back:active { transform: scale(0.9); background: var(--tg-theme-secondary-bg-color); }
.link-back svg { width: 22px; height: 22px; }
.link-sheet-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
    flex: 1;
    min-width: 0;
}
.link-steps { display: flex; align-items: center; gap: 5px; padding-right: 8px; }
.link-steps[hidden] { display: none; }
.link-step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0,0,0,0.14);
    transition: background var(--transition), width var(--transition);
}
.link-step-dot.is-on { background: var(--eco-green); width: 16px; border-radius: 3px; }
.link-sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 20px 8px;
}
.link-sheet-actions {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 20px max(16px, env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, var(--tg-theme-bg-color) 70%, transparent);
}
.link-actions-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.link-step { display: none; }
.link-step.is-active { display: block; animation: blurFadeIn 0.3s ease both; }

/* — Buttons — */
.link-btn {
    width: 100%;
    min-height: 52px;
    padding: 15px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition-fast), opacity var(--transition-fast), background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}
a.link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.link-btn:active { transform: scale(0.98); }
.link-btn[disabled] { opacity: 0.45; pointer-events: none; }
.link-btn--primary { background: var(--eco-green); color: #fff; box-shadow: var(--shadow-glow); }
.link-btn--ghost {
    background: transparent;
    color: var(--tg-theme-hint-color);
    font-weight: 600;
    min-height: 48px;
    box-shadow: none;
}
.link-btn--quiet { background: var(--tg-theme-secondary-bg-color); color: var(--tg-theme-text-color); }
.link-btn.is-busy { pointer-events: none; }
.link-btn.is-busy::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: -3px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* — Text blocks — */
.link-hero { text-align: center; margin-bottom: 22px; }
.link-hero-icon { font-size: 44px; margin-bottom: 10px; animation: checkBounce 0.5s cubic-bezier(0.34,1.56,0.64,1) both; }
.link-title { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.25; }
.link-sub {
    font-size: 14px;
    line-height: 1.5;
    color: var(--tg-theme-hint-color);
    margin-top: 8px;
    max-width: 34ch;
    margin-inline: auto;
}
.link-sub strong { color: var(--tg-theme-text-color); font-weight: 600; }
.link-step[data-link-step="email"] .link-sub,
.link-step[data-link-step="code"] .link-sub { margin-inline: 0; }
.link-field { margin-top: 22px; }
.link-field-hint {
    font-size: 12px;
    line-height: 1.45;
    color: var(--tg-theme-hint-color);
    margin-top: 8px;
    padding-left: 2px;
}
.link-help {
    font-size: 13px;
    line-height: 1.45;
    color: var(--tg-theme-hint-color);
    margin-top: 10px;
}
.link-help a { color: var(--eco-green); font-weight: 600; text-decoration: none; }
.link-notice {
    font-size: 13px;
    line-height: 1.45;
    color: var(--tg-theme-text-color);
    background: rgba(var(--eco-warm-rgb), 0.12);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 14px;
    animation: fadeIn 0.2s ease both;
}
.link-notice[hidden] { display: none; }

/* — Code cells — */
.otp-input { display: flex; gap: 8px; margin: 4px 0 14px; }
.otp-input[hidden] { display: none; }
.otp-cell {
    flex: 1 1 0;
    min-width: 0;
    max-width: 54px;
    height: 58px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    font-family: inherit;
    color: var(--tg-theme-text-color);
    background: var(--tg-theme-secondary-bg-color);
    border: 1.5px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-sm);
    outline: none;
    -webkit-appearance: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.otp-cell:focus {
    border-color: var(--eco-green);
    background: var(--tg-theme-bg-color);
    box-shadow: 0 0 0 3px rgba(var(--eco-green-rgb), 0.1);
}
.otp-input.is-error .otp-cell { border-color: var(--eco-error); }
.otp-input.is-error { animation: shake 0.4s ease; }
.link-code-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-top: 4px;
}
.link-code-actions[hidden] { display: none; }
.link-text-btn {
    background: none;
    border: none;
    padding: 12px 2px;
    font: 600 14px inherit;
    color: var(--eco-green);
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}
.link-text-btn[disabled] { color: var(--tg-theme-hint-color); opacity: 0.6; pointer-events: none; }
.link-timer {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    padding-left: 2px;
}
.link-timer[hidden] { display: none; }
.link-lock {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    margin: 4px 0 14px;
    font-size: 14px;
    line-height: 1.5;
}
.link-lock[hidden] { display: none; }
.link-lock-timer {
    display: block;
    margin-top: 8px;
    font-size: 20px;
    font-weight: 800;
    color: var(--eco-green);
    letter-spacing: -0.3px;
}

/* — Merge ledger — */
.merge-ledger {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.merge-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    animation: blurFadeUp 0.4s ease both;
}
.merge-row:last-child { border-bottom: none; }
.merge-row:nth-child(1) { animation-delay: 0.08s; }
.merge-row:nth-child(2) { animation-delay: 0.16s; }
.merge-row-icon { font-size: 20px; width: 24px; text-align: center; flex-shrink: 0; }
.merge-row-label { font-size: 15px; flex: 1; min-width: 0; }
.merge-row-count { font-size: 15px; font-weight: 700; white-space: nowrap; }
.merge-arrow {
    display: block;
    text-align: center;
    font-size: 18px;
    line-height: 1;
    padding: 10px 0;
    color: var(--tg-theme-hint-color);
    opacity: 0;
    animation: fadeIn 0.3s ease 0.32s both;
}
.merge-arrow[hidden] { display: none; }
.merge-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px 16px;
    background: var(--eco-green-bg);
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(var(--eco-green-rgb), 0.16);
    opacity: 0;
    animation: scaleIn 0.42s cubic-bezier(0.34,1.56,0.64,1) 0.44s both;
}
.merge-result .merge-row-label { font-weight: 600; }
.merge-result .merge-row-count { font-size: 20px; font-weight: 800; color: var(--eco-green); letter-spacing: -0.3px; }
.merge-hint {
    font-size: 12px;
    line-height: 1.45;
    color: var(--tg-theme-hint-color);
    text-align: center;
    margin-top: 10px;
    opacity: 0;
    animation: fadeIn 0.3s ease 0.52s both;
}
.merge-hint[hidden] { display: none; }
.merge-empty {
    font-size: 14px;
    line-height: 1.5;
    color: var(--tg-theme-hint-color);
    text-align: center;
    margin-top: 14px;
    opacity: 0;
    animation: fadeIn 0.3s ease 0.32s both;
}
.merge-empty[hidden] { display: none; }
.link-note {
    margin-top: 20px;
    padding: 14px 16px;
    background: rgba(var(--eco-warm-rgb), 0.10);
    border-left: 3px solid var(--eco-warm);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--tg-theme-text-color);
    opacity: 0;
    animation: fadeIn 0.35s ease 0.6s both;
}

/* — Entry points and status — */
.link-promo {
    margin: 0 16px 14px;
    padding: 18px;
    background: var(--tg-theme-bg-color);
    border: 1.5px dashed rgba(var(--eco-green-rgb), 0.28);
    border-radius: var(--radius-lg);
    text-align: center;
    animation: blurFadeUp 0.4s ease both;
}
.link-promo-icon { font-size: 30px; margin-bottom: 8px; }
.link-promo-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.link-promo-text { font-size: 13px; line-height: 1.5; color: var(--tg-theme-hint-color); margin-bottom: 14px; }
.link-promo .link-btn { min-height: 48px; font-size: 15px; }

.link-promo--inline {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 12px 14px;
    border-style: solid;
    border-color: rgba(0,0,0,0.06);
    background: var(--tg-theme-secondary-bg-color);
}
.link-promo--inline .link-promo-text { margin: 0; flex: 1; }
.link-promo--inline .link-promo-cta {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 12px 4px;
    font: 600 14px inherit;
    color: var(--eco-green);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.link-flash {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px 14px;
    padding: 12px 14px;
    background: var(--eco-green-bg);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--eco-green);
    animation: blurFadeUp 0.4s ease both;
    transition: opacity 0.4s ease;
}
.link-flash.is-leaving { opacity: 0; }

.link-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 20px 14px;
    padding: 2px 0;
}
.link-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--eco-green);
    box-shadow: 0 0 0 3px var(--eco-green-bg);
    flex-shrink: 0;
}
.link-status-title { display: block; font-size: 13px; font-weight: 600; }
.link-status-sub { display: block; font-size: 12px; color: var(--tg-theme-hint-color); margin-top: 1px; }
.link-status-more {
    margin-left: auto;
    background: none;
    border: none;
    padding: 12px 4px;
    font: 600 12px inherit;
    color: var(--tg-theme-hint-color);
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.link-status-details {
    margin: -6px 20px 14px;
    padding-left: 17px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--tg-theme-hint-color);
    animation: fadeIn 0.25s ease both;
}
.link-chip {
    margin-left: auto;
    border: none;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.link-skeleton { margin: 0 16px 14px; }

/* — Errors and net banner — */
.link-error {
    display: flex;
    gap: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--eco-error);
    margin: -4px 0 12px;
    animation: fadeIn 0.2s ease both;
}
.link-error[hidden] { display: none; }
.link-field .link-error { margin: 8px 0 0; }
.link-banner {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(100% + 8px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(var(--eco-warm-rgb), 0.16);
    border: 1px solid rgba(var(--eco-warm-rgb), 0.4);
    border-radius: var(--radius-md);
    font-size: 13px;
    animation: blurFadeUp 0.3s ease both;
}
.link-banner[hidden] { display: none; }
.link-banner-text { flex: 1; min-width: 0; line-height: 1.4; }
.link-banner-action {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 8px 4px;
    font: 700 13px inherit;
    color: var(--eco-green);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    .link-sheet,
    .link-step,
    .merge-row,
    .merge-result,
    .merge-arrow,
    .merge-hint,
    .merge-empty,
    .link-note,
    .link-hero-icon,
    .link-promo,
    .link-flash,
    .link-banner { animation: none; opacity: 1; transform: none; }
    .link-btn:active { transform: none; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Safe area padding */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .app {
        padding-bottom: calc(68px + env(safe-area-inset-bottom));
    }
}
