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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

@supports (padding: env(safe-area-inset-top)) {
    body {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
}

.container {
    width: 100%;
    max-width: 700px;
}

.form-wrapper {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-with-lang {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

h1 {
    color: #333;
    text-align: center;
    margin: 0;
    font-size: 2.5em;
    flex: 1;
}

.lang-switcher {
    display: flex;
    gap: 5px;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 4px;
}

.lang-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.lang-btn.active {
    background: #667eea;
    color: white;
}

.lang-btn:hover:not(.active) {
    background: #e0e0e0;
    color: #333;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.taxi-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.required {
    color: #e74c3c;
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

select {
    background-color: white;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.error-message {
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 5px;
    min-height: 20px;
    display: block;
}

input.error,
textarea.error {
    border-color: #e74c3c;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

body.telegram-webapp .submit-btn {
    display: none !important;
}

body:not(.telegram-webapp) .submit-btn {
    display: flex !important;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.submit-btn.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

.btn-loader {
    animation: spin 1s linear infinite;
}

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

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideDown 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

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

.modal-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.modal-body h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.modal-body p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 1.1em;
}

.modal-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    body { padding: 10px; }
    .form-wrapper { padding: 20px 15px; border-radius: 15px; }
    h1 { font-size: 1.8em; margin-bottom: 10px; }
    .subtitle { font-size: 1em; margin-bottom: 20px; }
    .header-with-lang { flex-direction: column; gap: 10px; align-items: center; }
    .taxi-form { gap: 12px; }
    .form-row { gap: 8px; }
    #from_location_row, #to_location_row { grid-template-columns: 1fr !important; }
    .form-group label { font-size: 0.85em; margin-bottom: 3px; }
    input, select, textarea { padding: 10px 12px; font-size: 0.95em; }
    .modal-content { padding: 30px 20px; }
}

@media (max-width: 480px) {
    .form-wrapper { padding: 15px 10px; }
    h1 { font-size: 1.5em; }
    .taxi-form { gap: 10px; }
    .form-group { gap: 3px; }
    .form-row { gap: 6px; }
    #from_location_row, #to_location_row { grid-template-columns: 1fr !important; }
    input, select, textarea { padding: 8px 10px; font-size: 0.9em; }
}

@media (max-width: 360px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

#bookingFields,
#passengersSection {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

#passengersSection h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.form-hint {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
}

.passenger-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.passenger-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.passenger-header h4 {
    color: #333;
    margin: 0;
    font-size: 1.1em;
}

.remove-passenger-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-acde
    justify-content: center;
    transition: all 0.3s ease;
}

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

.add-passenger-btn {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
}

.add-passenger-btn:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

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