:root {
    --primary: #eb1c24;
    --secondary: #022662;
    --light: #ffffff;
    --background: #ffffff;
    --text: #000000;
    --text-light: #555555;
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.08);
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html, body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* App container with proper mobile handling */
.app-container {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    position: relative;
    padding-bottom: 80px;
}

/* Authentication Banner */
.auth-banner {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid var(--warning);
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-banner-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    max-width: 360px;
    margin: 0 auto;
    gap: 12px;
}

.auth-banner-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.auth-banner-text {
    flex: 1;
    min-width: 0;
}

.auth-banner-title {
    font-weight: 600;
    color: #e65100;
    font-size: 14px;
    margin-bottom: 2px;
}

.auth-banner-subtitle {
    font-size: 12px;
    color: #f57c00;
    line-height: 1.3;
}

.auth-banner-subtitle a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-banner-subtitle a:hover {
    text-decoration: underline;
}

.auth-banner-close {
    font-size: 18px;
    color: #f57c00;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    flex-shrink: 0;
}

.auth-banner-close:hover {
    color: #e65100;
}

/* Headers */
.app-header {
    background: white;
    color: var(--light);
    padding: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.logo {
    height:100px;
    width: 250px;
    max-width: 400px;
    margin-bottom: 8px;
}

.company-tagline {
    color: #022662;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

.app-header h1 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 500;
}

.page-header {
    position: center;
    background: white;
    color: var(--secondary);
    padding: 1rem;
    text-align: center;
}

.page-header h1 {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #ffffff;
    width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Cards */
.card {
    background: #ffffff !important;
    border-radius: 16px;
    padding: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(235, 28, 36, 0.3);
    border: 2px solid #022662;
    transition: var(--transition);
}

.module-card {
    background: #ffffff;
    border: 2px solid #022662;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(235, 28, 36, 0.3);
    transition: all 0.3s ease;
}

.module-card:hover {
    box-shadow: 0 6px 20px rgba(2, 38, 98, 0.2);
    transform: translateY(-2px);
}

.module-header {
    background: transparent;
    color: #022662;
    padding: 16px 20px;
    margin: -16px -16px 20px -16px;
}

.module-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #022662;
    text-shadow: none;
}

.module-content {
    padding: 0;
}

.card:hover {
    box-shadow: 0 4px 12px var(--shadow);
    border-color: #ccc;
}

.card.highlight {
    border: 2px solid var(--primary);
    background: var(--light);
    box-shadow: 0 4px 16px rgba(235, 28, 36, 0.1);
}

.card.info-card {
    background: var(--light);
    border-color: var(--secondary);
    color: #022662;
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #022662;
    margin-bottom: 0.75rem;
    text-align: center;
}

.card h3 {
    font-size: 1rem;
    font-weight: 500;
    color: #022662;
    margin-bottom: 0.5rem;
    text-align: center;
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
    justify-content: space-between;
}

.button-group button {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border);
    background: var(--light);
    color: #022662;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    min-height: 48px;
    line-height: 1.5;
    box-sizing: border-box;
    text-align: center;
    vertical-align: middle;
    /* Windows-specific fixes */
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    pointer-events: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    position: relative;
    z-index: 1;
}

.button-group button:hover,
.button-group button:focus {
    border-color: var(--primary);
    background: #fef7f7;
    outline: none;
}

.button-group button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.button-group button.active {
    background: var(--white);
    color: var(--secondary);
    border-color: var(--primary);
}

/* Preset button styling */
.preset-btn {
    text-align: center;
    line-height: 1.3;
}

.preset-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.preset-params {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 400;
    line-height: 1.2;
}

.preset-btn.active .preset-params {
    opacity: 0.9;
}

/* Input Groups */
.input-group {
    margin-bottom: 1rem;
    position: relative;
}

.input-group label {
    display: block;
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group input[type="tel"],
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: var(--transition);
    background: #ffffff;
    font-family: inherit;
    color: #022662;
    box-shadow: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    line-height: 1.5;
    min-height: 56px;
    box-sizing: border-box;
}

.input-group input[type="text"]:focus,
.input-group input[type="number"]:focus,
.input-group input[type="tel"]:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    background: #e8eaed;
    box-shadow: none;
}

.input-group input[type="text"]::placeholder,
.input-group input[type="number"]::placeholder,
.input-group input[type="tel"]::placeholder,
.input-group select::placeholder,
.input-group textarea::placeholder {
    color: #5f6368;
    opacity: 1;
}

.input-group input.error,
.input-group select.error,
.input-group textarea.error {
    background: #ffeaea;
    box-shadow: 0 0 0 2px #ff4444;
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

.input-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    min-height: 1rem;
    line-height: 1.2;
}

/* Windows specific font fixes */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    * {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }
}

/* Edge specific fixes */
@supports (-ms-ime-align: auto) {
    .input-group input,
    .input-group select,
    .input-group textarea {
        border: 2px solid #ccc;
        background: #ffffff;
    }
}

/* Dimensions Form */
.dimensions-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1rem 0;
    width: 100%;
    box-sizing: border-box;
}

.dimensions-form .input-group:first-child {
    grid-column: 1 / -1;
}

.dimensions-form .input-group {
    width: 100%;
    box-sizing: border-box;
}

/* Price Display */
.price-card {
    background: white;
    border: 2px solid #022662;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(235, 28, 36, 0.15);
    overflow: hidden;
}

.price-container {
    padding: 20px;
}

.price-container h2 {
    text-align: center;
    color: #022662;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 600;
}

.price-box {
    background: transparent;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: #022662;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.price-amount {
    position: relative;
    z-index: 2;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #022662;
}

.price-details {
    position: relative;
    z-index: 2;
    opacity: 0.9;
    color: #022662;
}

.price-details small {
    font-size: 14px;
    color: #022662;
}

.usd-rate-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(2, 38, 98, 0.2);
}

.usd-rate-info small {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.price-display {
    text-align: center;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--radius);
    margin: 1rem 0;
}

.price-display span {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 1rem;
    background: var(--light);
    color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin: 1rem 0;
}
.primary-btn:hover{
    background: var(--light);
    color: var(--secondary);
    border-color: var(--primary);
}

.info-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    /* Windows-specific fixes */
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    pointer-events: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    position: relative;
    z-index: 1;
}

.info-btn:hover {
    background: var(--background);
    border-color: var(--secondary);
    color: var(--secondary);
}

.copy-btn {
    background: var(--secondary);
    color: var(--light);
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 0.5rem;
}

.copy-btn:hover {
    background: #1a3478;
}

/* Submit Section */
.submit-section {
    margin: 24px 0;
    text-align: center;
}

.submit-btn {
    background: var(--light);
    color: var(--secondary);
    border: var(--secondary) 2px solid;
    padding: 18px 32px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(235, 28, 36, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 200px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* Windows-specific fixes */
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    pointer-events: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    z-index: 1;
}

.submit-btn:hover {
    background: var(--light);
    border-color: var(--primary);
}

.submit-btn:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.submit-icon {
    font-size: 20px;
    animation: bounce 2s ease-in-out infinite;
}

.submit-text {
    font-weight: 600;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

/* Phone Input */
.phone-input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.telegram-phone-container {
    position: relative;
    width: 100%;
}

.phone-input-field {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 16px;
    gap: 12px;
    transition: all 0.3s ease;
}

.phone-input-field:hover {
    border-color: #eb1c24;
}

.phone-input-field:focus-within {
    border-color: #eb1c24;
    box-shadow: 0 0 0 3px rgba(235, 28, 36, 0.1);
}

.country-flag {
    font-size: 20px;
    cursor: pointer;
    min-width: 24px;
    user-select: none;
}

.phone-input-field input[type="tel"] {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.phone-input-field input[type="tel"]::placeholder {
    color: #999;
}

.dropdown-arrow {
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
    user-select: none;
}

.country-dropdown {
    position: fixed;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-height: 250px;
    overflow-y: auto;
    width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.country-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.country-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 9999;
    display: none;
}

.country-dropdown-backdrop.visible {
    display: block;
}

/* Custom Select Styles */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-field {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    box-sizing: border-box;
}

.custom-select-field:hover {
    border-color: #eb1c24;
}

.custom-select-field:focus-within {
    border-color: #eb1c24;
    box-shadow: 0 0 0 3px rgba(235, 28, 36, 0.1);
}

.custom-select-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.custom-select-value {
    flex: 1;
    font-size: 16px;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.custom-select-value:empty::before {
    content: attr(data-placeholder);
    color: #999;
}

.custom-dropdown {
    position: fixed;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-height: 250px;
    overflow-y: auto;
    width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    /* Windows compatibility */
    -ms-overflow-style: scrollbar;
    scrollbar-width: thin;
}

.custom-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-dropdown.hidden {
    display: none;
}

.custom-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 9999;
    display: none;
}

.custom-dropdown-backdrop.visible {
    display: block;
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.custom-option:hover {
    background: #f8f9fa;
}

.custom-option:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

.custom-option:first-child {
    border-radius: 10px 10px 0 0;
}

.option-icon {
    font-size: 18px;
    min-width: 20px;
}

.option-text {
    flex: 1;
}

.country-dropdown.hidden {
    display: none;
}

.country-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.country-option:hover {
    background: #f8f9fa;
}

.country-option:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

.country-option:first-child {
    border-radius: 10px 10px 0 0;
}

/* App Footer */
.app-footer {
    background: #f8f9fa;
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem;
    margin-top: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.footer-content {
    max-width: 100%;
    text-align: left;
    line-height: 1.6;
}

.footer-tagline {
    color: #022662;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.footer-description {
    color: #555555;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.footer-description p {
    color: #555555;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.footer-description p:last-child {
    margin-bottom: 0;
}

.footer-description strong {
    color: #022662;
    font-weight: 600;
}

.footer-final {
    font-weight: 600;
    color: #eb1c24;
    margin-top: 1rem;
}

/* Legal page styles */
.info-text {
    color: #555555;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #856404;
    cursor: pointer;
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid #eb1c24;
    border-radius: 3px;
    background: white;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    flex-shrink: 0;
    margin-top: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #eb1c24;
}

.benefit-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.benefit-content h3 {
    color: #022662;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-align: left;
}

.benefit-content p {
    color: #555555;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

textarea {
    background: #f8f9fa;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: #022662;
    resize: vertical;
    min-height: 80px;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
}

.btn-primary.full-width {
    width: 100%;
    background: white;
    color: #022662;
    border: 2px solid #022662;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.btn-primary.full-width:hover {
    background: #022662;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 38, 98, 0.3);
}

.btn-primary.full-width:active {
    transform: translateY(0);
}

.btn-primary.full-width:disabled {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* TabBar - fixed positioning */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 360px;
    display: flex;
    background: var(--light);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px var(--shadow);
    z-index: 1000;
}

.tab {
    flex: 1;
    padding: 0.75rem 0.5rem;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    /* Windows-specific fixes */
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    pointer-events: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    position: relative;
    z-index: 1;
}

.tab:hover {
    background: var(--background);
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    background: #fef7f7;
}

.tab-icon {
    font-size: 1.2rem;
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
}

.tab span {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 12px 12px 0 0;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: #f5f5f5;
    color: #333;
}

/* Success Modal */
.success-modal .modal-content {
    text-align: center;
    max-width: 400px;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.success-modal h2 {
    color: var(--primary);
    margin-bottom: 20px;
}

.order-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
}

.order-details p {
    margin: 5px 0;
    color: var(--text);
}

.success-note {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 20px 0;
}

.close-success-modal {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
}

/* Order Cards */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Order Details Modal */
.order-detail-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.order-detail-section h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span:first-child {
    font-weight: 500;
    color: var(--text-light);
}

.detail-row span:last-child {
    font-weight: 600;
    color: var(--text);
}

.detail-row .status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.detail-row .cost {
    color: var(--secondary);
    font-size: 1.1rem;
}

.detail-row .track-number {
    font-family: monospace;
    background: #e3f2fd;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: #1976d2;
}

.order-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow);
}

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

.order-id {
    font-weight: 600;
    color: var(--secondary);
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status.новый {
    background: #e3f2fd;
    color: #1976d2;
}

.status.в-пути {
    background: #fff3e0;
    color: #f57c00;
}

.status.доставлен {
    background: #e8f5e8;
    color: #388e3c;
}

.order-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.order-cost {
    font-weight: 600;
    color: var(--secondary);
}

/* Referral Page */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 4px var(--shadow);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.ref-link-container {
    display: flex;
    margin: 1rem 0;
}

.ref-link-container input {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ref-link-container button {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .75rem 1rem;
    background: var(--light);
    color: var(--secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px var(--shadow);
    transition: background .2s, transform .1s;
}

.ref-link-container button:hover {
    border-color: var(--primary);    
    background: #fef7f7;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 2500;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--light);
    color: var(--text);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 16px var(--shadow);
    border-left: 4px solid var(--primary);
    max-width: 300px;
    transform: translateX(100%);
    transition: var(--transition);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

.toast.warning {
    border-left-color: var(--warning);
}

/* Responsive Design */
@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
        padding-bottom: 70px;
    }

    .tab-bar {
        max-width: 100%;
    }

    .button-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .dimensions-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-width: none;
    }
}

@media (max-width: 320px) {
    .app-container {
        padding-bottom: 60px;
    }

    .card {
        padding: 0.75rem;
    }

    .main-content {
        padding: 0.75rem;
    }
}

@media (min-width: 400px) {
    .app-container {
        max-width: 400px;
    }

    .tab-bar {
        max-width: 400px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .app-container {
        padding-bottom: 60px;
    }

    .tab-bar {
        padding: 0.5rem 0;
    }

    .tab {
        padding: 0.5rem 0.25rem;
    }

    .tab-icon {
        font-size: 1rem;
    }

    .tab span {
        font-size: 0.6rem;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border: #000;
        --shadow: rgba(0, 0, 0, 0.3);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px solid var(--border);
    background: var(--light);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.share-btn:hover {
    border-color: var(--primary);
    background: #fef7f7;
}

