/* Modern Full-Screen Duolingo-Style Invoice Wizard */

/* CSS Reset and Base Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Telegram Web App theme integration with fallbacks */
    --tg-bg-color: var(--tg-theme-bg-color, #ffffff);
    --tg-text-color: var(--tg-theme-text-color, #000000);
    --tg-hint-color: var(--tg-theme-hint-color, #707579);
    --tg-button-color: var(--tg-theme-button-color, #2481cc);
    --tg-button-text-color: var(--tg-theme-button-text-color, #ffffff);
    --tg-secondary-bg-color: var(--tg-theme-secondary-bg-color, #f1f3f4);
    
    /* Modern color palette */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warning: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    /* Spacing and layout */
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
    --safe-area-left: env(safe-area-inset-left);
    --safe-area-right: env(safe-area-inset-right);
    
    --step-padding: max(20px, env(safe-area-inset-left));
    --bottom-padding: max(20px, env(safe-area-inset-bottom));
    
    /* Animations */
    --ease-in-out-quart: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --slide-duration: 0.4s;
    
    /* Sizes */
    --input-height: 56px;
    --button-height: 52px;
    --progress-height: 80px;
}

/* Base body setup with full viewport */
html {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background: var(--tg-bg-color);
    color: var(--tg-text-color);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Main app container with full viewport */
.app-container {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Header with safe area and back button */
.wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--safe-area-top) + 12px) var(--step-padding) 12px;
    background: var(--tg-bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 100;
    min-height: calc(var(--safe-area-top) + 60px);
    position: relative;
}

/* Center step counter when back button is hidden */
.wizard-header .step-counter {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s var(--ease-out-expo);
}

/* Adjust step counter position when back button is visible */
.wizard-header .back-button:not([disabled]) ~ .step-counter {
    position: static;
    transform: none;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    color: var(--tg-text-color);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    touch-action: manipulation;
}

.back-button:hover,
.back-button:active {
    background: rgba(0, 0, 0, 0.08);
    transform: scale(0.95);
}

.back-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.step-counter {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-hint-color);
}

.skip-button {
    background: none;
    border: none;
    color: var(--tg-button-color);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.skip-button:hover,
.skip-button:active {
    background: rgba(36, 129, 204, 0.1);
}

/* Step container with full remaining height */
.steps-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Individual step styling */
.step {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: var(--step-padding);
    padding-bottom: calc(var(--progress-height) + var(--bottom-padding) + env(keyboard-inset-height, 0px));
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--slide-duration) var(--ease-in-out-quart);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    
    /* Ensure content is scrollable when keyboard is open */
    min-height: 100%;
}

.step.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 2;
}

.step.prev {
    transform: translateX(-100%);
    z-index: 1;
}

.step.next {
    transform: translateX(100%);
    z-index: 1;
}

/* Step content */
.step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.step-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--tg-text-color);
    margin-bottom: 8px;
    line-height: 1.2;
}

.step-description {
    font-size: 16px;
    color: var(--tg-hint-color);
    margin-bottom: 32px;
    line-height: 1.4;
}

/* Form elements with modern styling */
.form-section {
    margin-bottom: 24px;
}

.form-group {
    position: relative; /* For dropdown positioning */
    margin-bottom: 20px;
}

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

.form-label.required::after {
    content: " *";
    color: #ef4444;
}

.label-hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--tg-hint-color);
    margin-left: 8px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    height: var(--input-height);
    padding: 0 16px;
    background: var(--tg-secondary-bg-color);
    border: 2px solid transparent;
    border-radius: 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    color: var(--tg-text-color);
    transition: all 0.3s var(--ease-out-expo);
    outline: none;
    -webkit-appearance: none;
    touch-action: manipulation;
    scroll-margin: 80px; /* Space for keyboard when scrolling into view */
}

.form-textarea {
    height: auto;
    min-height: 120px;
    padding: 16px;
    resize: vertical;
    line-height: 1.5;
}

/* Input focus states */
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--tg-button-color);
    background: var(--tg-bg-color);
    box-shadow: 0 0 0 4px rgba(36, 129, 204, 0.1);
    transform: translateY(-1px);
}

/* Input error states */
.form-input.error,
.form-textarea.error,
.form-select.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Success states */
.form-input.success,
.form-textarea.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

/* Input row layout */
.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Number inputs for mobile keyboards */
input[type="number"],
input[type="tel"],
.numeric-input {
    inputmode: numeric;
    pattern: "[0-9]*";
}

input[type="tel"] {
    inputmode: tel;
}

/* Paste area for requisites */
.paste-area {
    background: var(--tg-secondary-bg-color);
    border: 2px dashed var(--tg-hint-color);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 24px;
}

/* Compact paste area when user has client history - saves vertical space for dropdown */
.paste-area.has-history {
    padding: 20px 16px;
    margin-bottom: 16px;
}

.paste-area.has-history .paste-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.paste-area.has-history .paste-text {
    font-size: 14px;
    margin-bottom: 4px;
}

.paste-area.has-history .paste-hint {
    display: none; /* Hide the hint text to save space */
}

.paste-area:hover,
.paste-area.dragover {
    border-color: var(--tg-button-color);
    background: rgba(36, 129, 204, 0.05);
}

.paste-icon {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.paste-text {
    font-size: 16px;
    color: var(--tg-hint-color);
    margin-bottom: 8px;
}

.paste-hint {
    font-size: 14px;
    color: var(--tg-hint-color);
    opacity: 0.8;
}

/* Service selection cards */
.service-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

/* Legacy .service-card - DEPRECATED, use .predefined-service-card instead */
.service-card {
    background: var(--tg-secondary-bg-color);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
    touch-action: manipulation;
}

.service-card:hover {
    border-color: var(--tg-button-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.service-card.selected {
    border-color: var(--tg-button-color);
    background: rgba(36, 129, 204, 0.1);
}

.service-card.selected::after {
    content: "✓";
    position: absolute;
    top: 12px;
    right: 16px;
    width: 24px;
    height: 24px;
    background: var(--tg-button-color);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.service-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-text-color);
    margin-bottom: 4px;
}

.service-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--tg-button-color);
}

/* Add service button */
.add-service-button {
    background: var(--tg-secondary-bg-color);
    border: 2px dashed var(--tg-hint-color);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--tg-hint-color);
    font-size: 16px;
    font-weight: 500;
}

.add-service-button:hover {
    border-color: var(--tg-button-color);
    color: var(--tg-button-color);
    background: rgba(36, 129, 204, 0.05);
}

.add-service-button.disabled {
    border-color: rgba(112, 117, 121, 0.4);
    color: rgba(112, 117, 121, 0.7);
    cursor: not-allowed;
    background: var(--tg-secondary-bg-color);
    opacity: 0.7;
}

.add-service-button.disabled:hover {
    border-color: rgba(112, 117, 121, 0.4);
    color: rgba(112, 117, 121, 0.7);
    background: var(--tg-secondary-bg-color);
}

/* Total amount display */
.total-display {
    background: var(--gradient-primary);
    color: white;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    margin: 24px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.total-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.total-amount {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

/* Preview cards */
.preview-section {
    background: var(--tg-bg-color);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.preview-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--tg-text-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-edit-button {
    margin-left: auto;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tg-button-color);
    background: rgba(36, 129, 204, 0.12);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.preview-edit-button:hover,
.preview-edit-button:focus {
    background: rgba(36, 129, 204, 0.2);
    transform: translateY(-1px);
}

.preview-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.preview-field:last-child {
    border-bottom: none;
}

.preview-label {
    font-size: 14px;
    color: var(--tg-hint-color);
    font-weight: 500;
    flex: 1;
    line-height: 1.3;
}

.preview-value {
    font-size: 14px;
    color: var(--tg-text-color);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    line-height: 1.3;
}

/* Progress indicator at bottom - only shows dots now */
.progress-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--tg-bg-color);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 16px var(--step-padding) calc(16px + var(--bottom-padding));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.4s var(--ease-out-expo);
}

/* Floating action button container */
.floating-action-container {
    position: fixed;
    bottom: 80px; /* Above progress dots */
    right: var(--step-padding);
    z-index: 10000;
    transition: all 0.4s var(--ease-out-expo);
}

/* When keyboard is open, move button above keyboard and dim progress dots */
.floating-action-container.keyboard-open {
    bottom: calc(var(--keyboard-height, 300px) + 20px);
    transform: scale(0.95);
}

.progress-container.keyboard-open {
    opacity: 0.6;
    transform: translateY(10px);
}

.progress-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s var(--ease-out-expo);
}

.progress-dot.active {
    background: var(--tg-button-color);
    transform: scale(1.25);
}

.progress-dot.completed {
    background: #10b981;
}

/* Action button */
.action-button {
    height: var(--button-height);
    padding: 0 32px;
    background: var(--tg-button-color);
    color: var(--tg-button-text-color);
    border: none;
    border-radius: 26px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
    touch-action: manipulation;
    box-shadow: 0 2px 12px rgba(36, 129, 204, 0.3);
}

.action-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(36, 129, 204, 0.4);
}

.action-button:active {
    transform: translateY(-1px);
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mobile touch feedback */
.action-button.button-pressed {
    transform: translateY(0px) scale(0.95);
    background: var(--tg-button-color);
    opacity: 0.8;
    transition: all 0.1s ease;
}

/* Floating button specific styles */
.action-button.floating-button {
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(36, 129, 204, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 100px;
    font-size: 15px;
}

.action-button.loading {
    pointer-events: none;
}

.action-button.success {
    background: #10b981;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.3);
}

/* Loading states */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

/* Status messages */
.status-message {
    position: fixed;
    top: calc(var(--safe-area-top) + 80px);
    left: var(--step-padding);
    right: var(--step-padding);
    background: var(--tg-bg-color);
    border-radius: 16px;
    padding: 16px 20px;
    z-index: 200;
    transform: translateY(-120%);
    transition: all 0.4s var(--ease-out-expo);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--tg-button-color);
}

.status-message.show {
    transform: translateY(0);
}

.status-message.error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-message.success {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

/* Swipe indicator removed - using button navigation only */

/* Responsive adjustments */
@media (max-width: 480px) {
    :root {
        --step-padding: max(16px, env(safe-area-inset-left));
    }
    
    .step-title {
        font-size: 24px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .form-row .form-group {
        margin-bottom: 16px;
        width: 100%;
    }
    
    .total-amount {
        font-size: 28px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --tg-bg-color: var(--tg-theme-bg-color, #1a1a1a);
        --tg-text-color: var(--tg-theme-text-color, #ffffff);
        --tg-hint-color: var(--tg-theme-hint-color, #8e8e93);
        --tg-secondary-bg-color: var(--tg-theme-secondary-bg-color, #2c2c2e);
    }
}

/* Success celebration animation */
.celebrate {
    animation: celebrate 0.6s ease-out;
}

@keyframes celebrate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Success field animation for parsed inputs */
.form-input.success,
.form-textarea.success {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Hide scrollbars but keep functionality */
.step::-webkit-scrollbar {
    display: none;
}

.step {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Accessibility improvements */
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible,
.action-button:focus-visible,
.back-button:focus-visible {
    outline: 2px solid var(--tg-button-color);
    outline-offset: 2px;
}

/* Enhanced Service Interface Styles */
.service-limit-status {
    display: none;
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(36, 129, 204, 0.08);
    color: var(--tg-text-color);
    font-size: 14px;
    font-weight: 600;
}

.service-limit-status.visible {
    display: flex;
}

.custom-service-item {
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    transition: all 0.3s ease;
}

.custom-service-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.service-remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 10;
}

.service-remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.price-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.price-input-container .form-input {
    padding-right: 32px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', 'Monaco', 'Menlo', monospace;
    font-variant-numeric: tabular-nums;
}

.price-currency {
    position: absolute;
    right: 16px;
    color: var(--text-secondary);
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}

.inline-price-input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', 'Monaco', 'Menlo', monospace !important;
    font-variant-numeric: tabular-nums !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    min-width: 80px !important;
}

.inline-price-input:focus {
    background: var(--bg-surface) !important;
    box-shadow: 0 0 0 2px var(--accent-color) !important;
}

.currency-symbol {
    margin-left: 4px;
    color: var(--text-secondary);
    font-weight: 500;
}

.service-card.editing {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.service-card .service-price {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--accent-color);
    min-height: 24px;
}

/* Payment Information Styles */
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--tg-text-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.invoice-section .section-title {
    margin-bottom: 4px;
    display: block;
}

.field-hint {
    font-size: 12px;
    color: var(--tg-hint-color);
    margin-top: 6px;
    line-height: 1.4;
    opacity: 0.8;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

/* Step 4 minimal layout */
.invoice-compact {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.compact-card {
    background: var(--tg-bg-color);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
}

.compact-card-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compact-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-text-color);
}

.compact-card-hint {
    font-size: 13px;
    color: rgba(55, 65, 81, 0.7);
}

.compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.contract-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contract-input.minimal .form-input {
    flex: 1;
    height: var(--input-height);
}

.preset-pill {
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 999px;
    background: transparent;
    color: var(--tg-button-color);
    font-weight: 600;
    font-size: 13px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-pill:hover,
.preset-pill:focus {
    background: rgba(36, 129, 204, 0.08);
    box-shadow: 0 0 0 2px rgba(36, 129, 204, 0.12);
}

/* Default value indicators */
.default-indicator {
    font-size: 11px;
    font-weight: 500;
    color: rgba(55, 65, 81, 0.65);
    margin-left: 6px;
}

@media (max-width: 480px) {
    .compact-card {
        padding: 14px;
    }

    .contract-input {
        flex-direction: column;
        align-items: stretch;
    }

    .preset-pill {
        width: 100%;
        text-align: center;
    }
}

/* Enhanced select styling for mobile */
.form-input[type="text"], 
.form-input[type="date"],
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23707579'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
}

select.form-input:focus {
    background-color: var(--tg-bg-color);
    border-color: var(--tg-button-color);
    box-shadow: 0 0 0 4px rgba(36, 129, 204, 0.1);
}

/* Mobile-optimized select options */
select.form-input option {
    padding: 12px 16px;
    background: var(--tg-bg-color);
    color: var(--tg-text-color);
    font-size: 16px;
    line-height: 1.4;
}

/* Form section spacing */
.form-section + .form-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(112, 117, 121, 0.1);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .step {
        transition: opacity 0.2s ease;
    }
}

