@import url('/bitrix/templates/cpk-abc/css/fonts.css');

:root {
    --wd-violet: #630778;
    --wd-violet-dark: #4a0559;
    --wd-violet-muted: rgba(99, 7, 120, 0.08);
    --wd-bg: #f4f2f7;
    --wd-card: #ffffff;
    --wd-border: #e8e5ee;
    --wd-surface: rgba(99, 7, 120, 0.04);
    --wd-surface-hover: rgba(99, 7, 120, 0.08);
    --wd-surface-border: #e0dce8;
    --wd-text: #1a1a2e;
    --wd-text-muted: #6b6b80;
    --wd-text-dim: #999;
    --wd-input-bg: #f8f7fa;
    --wd-success: #10b981;
    --wd-warning: #f59e0b;
}

body{
    margin: 0;
    padding: 0;
}

.wd-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 100vh;
    min-height: 100dvh;
    background: #050505;
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wd-card {
    width: 100%;
    max-width: 550px;
    background: var(--wd-card);
    border-radius: 28px;
    position: relative;
    box-shadow: 0 24px 64px -16px rgba(99, 7, 120, 0.18);
    overflow: hidden;
}

.wd-card-top {
    background: linear-gradient(160deg, #510a62 0%, #630778 40%, #7b1fa2 100%);
    padding: 1.5rem 2rem;
    text-align: center;
}

.wd-logo {
    display: block;
    text-decoration: none;
}

.wd-logo svg {
    height: 35px;
    width: auto;
}

.wd-content {
    padding: 2rem 2rem 2.5rem;
}

.wd-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    text-align: center;
    margin: 0 0 0.75rem;
    color: var(--wd-text);
}

.wd-page-subtitle {
    font-size: 1rem;
    color: var(--wd-text-muted);
    text-align: center;
    margin: 0 0 2rem;
    line-height: 1.5;
    letter-spacing: -0.02em;
}

/* Director card */
.wd-director-card {
    background: var(--wd-surface);
    border: 1px solid var(--wd-surface-border);
    border-radius: 20px;
    padding: 1.75rem;
    margin-bottom: 2rem;
}

.wd-director-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.wd-director-avatar {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--wd-violet-muted);
}

.wd-director-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wd-director-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wd-director-name {
    font-size: 1.07rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--wd-text);
}

.wd-director-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--wd-success);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 0.875rem;
    border-radius: 100px;
    width: fit-content;
}

.wd-director-badge svg { width: 14px; height: 14px; }

.wd-director-quote {
    font-size: 0.9375rem;
    color: var(--wd-text-muted);
    line-height: 1.2;
    padding-left: 1rem;
    border-left: 2px solid var(--wd-violet);
}

/* Form */
.wd-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.wd-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.wd-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--wd-text-muted);
    margin-bottom: 0.125rem;
}

.wd-required { color: var(--wd-violet); }

.wd-input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--wd-input-bg);
    border: 1px solid var(--wd-surface-border);
    border-radius: 14px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--wd-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.wd-input::placeholder { color: var(--wd-text-dim); }

.wd-input:focus {
    border-color: var(--wd-violet);
    box-shadow: 0 0 0 3px rgba(99, 7, 120, 0.12);
}

.wd-input.has-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.wd-select {
    cursor: pointer;
    appearance: none;
    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='%236b6b80' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.wd-select option { background: var(--wd-card); color: var(--wd-text); }

.wd-textarea { min-height: 104px; resize: none; }

.wd-error {
    font-size: 0.875rem;
    color: #ef4444;
    display: none;
    line-height: 1.3;
    margin-top: 0.25rem;
}
.wd-error.is-visible { display: block; }

.wd-error--general.is-visible {
    margin: 0 0 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
}


.wd-agreement { margin: 0.5rem 0 0; }

.wd-agreement-label {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wd-agreement-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.wd-agreement-check {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 5px;
    border: 1px solid var(--wd-surface-border);
    background: var(--wd-input-bg);
    position: relative;
    transition: all 0.2s ease;
}

.wd-agreement-input:checked + .wd-agreement-check {
    background: var(--wd-violet);
    border-color: var(--wd-violet);
}

.wd-agreement-input:checked + .wd-agreement-check::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 11px;
    background-image: url('/bitrix/templates/cpk-abc/images/check-popup.svg');
}

.wd-agreement-text {
    font-size: 0.875rem;
    color: var(--wd-text-dim);
    line-height: 1.5;
    flex: 1;
}

.wd-agreement-text a {
    color: var(--wd-text-muted);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.wd-agreement-text a:hover { color: var(--wd-text); }

/* Submit button */
.wd-submit {
    width: 100%;
    padding: 1.125rem 1.5rem;
    background: linear-gradient(145deg, #7b1fa2, var(--wd-violet));
    border: none;
    border-radius: 14px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 24px -8px rgba(99, 7, 120, 0.4);
    margin-top: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}

.wd-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -8px rgba(99, 7, 120, 0.5);
}

.wd-submit:active { transform: scale(0.98); }

.wd-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Process block */
.wd-process {
    padding: 1.5rem;
    background: var(--wd-surface);
    border: 1px solid var(--wd-surface-border);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.wd-section-label {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wd-text-dim);
    margin-bottom: 1rem;
}

.wd-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.wd-step {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wd-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wd-step-icon svg { width: 20px; height: 20px; }

.wd-step-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--wd-text);
    margin-bottom: 0.125rem;
}

.wd-step-desc {
    font-size: 0.875rem;
    color: var(--wd-text-dim);
}

/* Stats */
.wd-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.wd-stat {
    text-align: center;
    padding: 1.25rem 1rem;
    background: var(--wd-surface);
    border: 1px solid var(--wd-surface-border);
    border-radius: 14px;
}

.wd-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
}

.wd-stat-value--primary { color: var(--wd-success); }
.wd-stat-value--accent { color: var(--wd-violet); }

.wd-stat-label {
    font-size: 0.875rem;
    color: var(--wd-text-dim);
    line-height: 1.3;
}

/* Divider */
.wd-divider {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin: 0 0 1.25rem;
    color: var(--wd-text-dim);
    font-size: 0.875rem;
}

.wd-divider::before,
.wd-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--wd-surface-border);
}

/* Quick contacts — always in 1 row */
.wd-quick {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.wd-quick-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    background: var(--wd-surface);
    border: 1px solid var(--wd-surface-border);
    border-radius: 16px;
    color: var(--wd-text);
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.wd-quick-btn:hover {
    background: var(--wd-surface-hover);
    border-color: rgba(99, 7, 120, 0.15);
    color: var(--wd-text);
    text-decoration: none;
}

.wd-quick-btn:active { transform: scale(0.98); }

.wd-quick-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wd-quick-icon svg {
    width: 50px;
    height: 50px;
}

.wd-quick-icon img {
    width: 50px;
    height: 50px;
    display: block;
}

.wd-quick-btn--tg .wd-quick-icon svg{
    fill: #2aabee;
}

.wd-quick-btn--wa .wd-quick-icon svg {
    fill: #25d366;
}

.wd-quick-info { width: 100%; }

.wd-quick-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.wd-quick-response {
    font-size: 0.875rem;
    color: var(--wd-success);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.wd-quick-response::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--wd-success);
    border-radius: 50%;
    animation: wd-pulse-dot 2s infinite;
}

@keyframes wd-pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Back link */
.wd-back {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--wd-text-dim);
    text-decoration: none;
    transition: color 0.2s ease;
}

.wd-back:hover { color: var(--wd-text-muted); }

/* ===== Success state ===== */
.wd-success {
    display: none;
    text-align: center;
    animation: wd-fade-in 0.4s ease;
}

.wd-success.is-visible { display: block; }
.wd-form-state.is-hidden { display: none; }

@keyframes wd-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wd-success-icon {
    margin: 0 auto 1.5rem;
    position: relative;
    width: 80px;
    height: 80px;
}

.wd-success-icon::before {
    content: '';
    position: absolute;
    inset: -16px;
    background: radial-gradient(circle, rgba(99, 7, 120, 0.12), transparent 70%);
    border-radius: 50%;
}

.wd-success-circle {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #7b1fa2, var(--wd-violet));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 32px -8px rgba(99, 7, 120, 0.4);
}

.wd-success-circle svg { width: 40px; height: 40px; }

.wd-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 1.5rem;
    color: var(--wd-text);
}

.wd-ref {
    background: var(--wd-surface);
    border: 1px solid var(--wd-surface-border);
    border-radius: 14px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.wd-ref-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--wd-text-dim);
    margin-bottom: 0.25rem;
}

.wd-ref-value { font-size: 1.125rem; font-weight: 700; color: var(--wd-violet); }

.wd-success-text {
    font-size: 1rem;
    color: var(--wd-text-muted);
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

/* Timeline */
.wd-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--wd-surface);
    border: 1px solid var(--wd-surface-border);
    border-radius: 14px;
    text-align: left;
}

.wd-timeline-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0;
    position: relative;
}

.wd-timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 5px;
    top: calc(0.625rem + 12px + 4px);
    bottom: -4px;
    width: 2px;
    background: var(--wd-surface-border);
}

.wd-timeline-item.active::after {
    background: linear-gradient(to bottom, var(--wd-violet), var(--wd-surface-border));
}

.wd-timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--wd-surface-border);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.wd-timeline-item.active .wd-timeline-dot {
    background: var(--wd-violet);
    box-shadow: 0 0 0 4px rgba(99, 7, 120, 0.15);
}

.wd-timeline-text {
    font-size: 0.875rem;
    color: var(--wd-text-dim);
}

.wd-timeline-item.active .wd-timeline-text {
    color: var(--wd-text);
    font-weight: 500;
}

.wd-success-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--wd-surface);
    border: 1px solid var(--wd-surface-border);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--wd-text-muted);
}

.wd-success-badge svg { width: 16px; height: 16px; color: var(--wd-violet); }

.wd-close{
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: #f6f6f6;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wd-close svg path{
    transition: 0.3s;
    stroke: var(--wd-violet);
}

.wd-close:hover{
    cursor: pointer;
}
.wd-close:hover svg path {
    stroke: #9E9E9E;
}

@media (max-width: 767px) {
    .wd-page {
        padding: 1.5rem 1rem;
    }
    .wd-close{
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 575px) {
    .wd-page {
        padding: 0;
        align-items: flex-start;
    }

    .wd-card {
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .wd-card-top {
        padding: 2rem 1.25rem 1.5rem;
    }

    .wd-card-top .wd-logo svg {
        height: 30px;
    }

    .wd-content {
        padding: 1.5rem 1.25rem 2rem;
    }

    .wd-page-title {
        font-size: 1.5rem;
    }

    .wd-director-card {
        padding: 1.25rem;
    }

    .wd-director-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .wd-director-badge {
        margin: 0 auto;
    }

    .wd-quick {
        flex-direction: column;
        gap: 0.5rem;
    }

    .wd-quick-btn {
        flex-direction: row;
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }

    .wd-quick-btn .wd-quick-info {
        width: auto;
        flex: 1;
        text-align: left;
    }

    .wd-quick-icon {
        width: 40px;
        height: 40px;
    }

    .wd-quick-icon svg {
        width: 40px;
        height: 40px;
    }

    .wd-quick-icon img {
        width: 40px;
        height: 40px;
    }

    .wd-process {
        padding: 1.25rem;
    }

    .wd-stats {
        gap: 0.75rem;
    }

    .wd-stat {
        padding: 1rem 0.75rem;
    }

    .wd-stat-value {
        font-size: 1.5rem;
    }

    .wd-timeline {
        padding: 1rem 1.25rem;
    }

    .wd-ref {
        padding: 0.875rem 1.25rem;
    }

    .wd-success-badge {
        padding: 0.75rem 1.25rem;
    }
}

@media (max-width: 374px) {
    .wd-card-top {
        padding: 1.5rem 1rem 1.25rem;
    }

    .wd-card-top .wd-logo svg {
        height: 26px;
    }

    .wd-content {
        padding: 1.25rem 1rem 1.5rem;
    }

    .wd-page-title {
        font-size: 1.375rem;
    }

    .wd-director-card {
        padding: 1rem;
    }

    .wd-quick-btn {
        padding: 0.75rem 0.75rem;
        gap: 0.5rem;
    }

    .wd-quick-icon {
        width: 36px;
        height: 36px;
    }

    .wd-quick-icon svg {
        width: 36px;
        height: 36px;
    }

    .wd-quick-icon img {
        width: 36px;
        height: 36px;
    }

    .wd-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .wd-input {
        padding: 0.875rem 1rem;
    }
}
