:root {
    --bg: #060F24;
    --bg-card: #112456;
    --bg-input: rgba(227, 229, 231, 0.05);
    --primary: #4A72E8;
    --primary-dark: #1B3272;
    --primary-glow: rgba(74, 114, 232, 0.28);
    --accent: #BA9B5F;
    --accent-hover: #B9914F;
    --accent-glow: rgba(186, 155, 95, 0.35);
    --white: #E3E5E7;
    --muted: rgba(227, 229, 231, 0.6);
    --border: rgba(227, 229, 231, 0.1);
    --border-hover: rgba(74, 114, 232, 0.35);
    --success: #26a17b;
    --error: #ef4444;
    --error-light: #fca5a5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 60px rgba(74, 114, 232, 0.12);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    background: var(--bg);
    min-height: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--white);
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

.container {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 32px 30px 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--primary), transparent);
    opacity: 0.95;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.form-header {
    text-align: center;
    margin-bottom: 22px;
}

.form-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.form-header p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.45;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

label.required::after {
    content: " *";
    color: var(--accent);
    font-size: 12px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-input);
    color: var(--white);
    transition: var(--transition);
    font-family: inherit;
    letter-spacing: -0.01em;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-hover);
    background: rgba(227, 229, 231, 0.08);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(74, 114, 232, 0.08);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

input::placeholder,
textarea::placeholder {
    color: rgba(227, 229, 231, 0.35);
    font-weight: 400;
}

.phone-input {
    display: flex;
    align-items: stretch;
}

.phone-prefix {
    padding: 12px 14px;
    background: rgba(227, 229, 231, 0.07);
    border: 1.5px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

#phone {
    border-radius: 0 var(--radius) var(--radius) 0;
}

select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23BA9B5F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 44px;
}

select option {
    background: #0B1938;
    color: var(--white);
    padding: 12px;
}

textarea {
    height: 78px;
    resize: vertical;
    line-height: 1.45;
}

.error-text {
    color: var(--error-light);
    font-size: 11.5px;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

button[type="submit"] {
    width: 100%;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: 1px solid rgba(186, 155, 95, 0.35);
    border-radius: var(--radius);
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(74, 114, 232, 0.35);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 4px;
    position: relative;
    overflow: hidden;
}

button[type="submit"]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
    pointer-events: none;
}

button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 8px 28px rgba(74, 114, 232, 0.5), 0 0 16px var(--accent-glow);
}

button[type="submit"]:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(74, 114, 232, 0.3);
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.captcha {
    margin-bottom: 18px;
    text-align: center;
    padding: 14px;
    background: rgba(227, 229, 231, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.captcha-question {
    display: inline-block;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
    letter-spacing: 0.04em;
}

.captcha input {
    width: auto;
    min-width: 130px;
    text-align: center;
    margin: 0 auto;
    display: block;
    font-weight: 600;
}

.honeypot {
    position: absolute;
    left: -9999px;
}

.shake {
    animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 15, 36, 0.88);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 28px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--primary), transparent);
    opacity: 0.9;
}

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

.modal-icon {
    font-size: 56px;
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
}

.modal-icon svg {
    width: 100%;
    height: 100%;
}

.modal-icon.success {
    color: var(--accent);
    filter: drop-shadow(0 4px 12px var(--accent-glow));
}

.modal-icon.error {
    color: var(--error);
    filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.4));
}

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--white);
    letter-spacing: -0.02em;
}

.modal-message {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.55;
}

.modal-button {
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: 1px solid rgba(186, 155, 95, 0.35);
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(74, 114, 232, 0.3);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.modal-button:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(74, 114, 232, 0.45);
}

@media (max-width: 500px) {
    body {
        padding: 12px;
    }
    .container {
        padding: 24px 18px 20px;
        border-radius: 16px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .modal-content {
        padding: 28px 20px 22px;
    }
    select {
        font-size: 13px;
        padding: 12px 36px 12px 12px;
    }
    input,
    textarea {
        font-size: 13.5px;
    }
    .phone-prefix {
        font-size: 13.5px;
        padding: 12px 10px;
    }
}
