:root {
    --tmd-font: var(--e-global-typography-e592875-font-family, "Freight Sans Pro");
    --tmd-text: var(--e-global-color-abe8bb1, #1e1e1e);
    --tmd-muted: var(--e-global-color-text, #7a7a7a);
    --tmd-heading: var(--e-global-color-d14665a, #363940);
    --tmd-accent: var(--e-global-color-c73bbf2, #782b81);
    --tmd-accent-rgb: 120, 43, 129;
    --tmd-link: var(--e-global-color-c73bbf2, #782b81);
    --tmd-surface: var(--e-global-color-5385f10, #ffffff);
    --tmd-border: rgba(149, 161, 187, 0.28);
    --tmd-border-strong: rgba(149, 161, 187, 0.45);
    --tmd-shadow: 0 18px 45px rgba(54, 57, 64, 0.09);
}

.tmd-download-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 34px 34px 30px;
    border: 1px solid var(--tmd-border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.9) 100%);
    box-shadow: var(--tmd-shadow);
    color: var(--tmd-text);
    font-family: var(--tmd-font), sans-serif;
}

.tmd-download-form {
    display: grid;
    gap: 18px;
}

.tmd-field-group {
    margin: 0;
}

.tmd-field-group label {
    display: flex;
    margin-bottom: 8px;
    color: var(--tmd-heading);
    font-family: var(--tmd-font), sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.tmd-field-group select,
.tmd-field-group input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid var(--tmd-border-strong);
    border-radius: 12px;
    background: var(--tmd-surface);
    color: var(--tmd-text);
    font-family: var(--tmd-font), sans-serif;
    font-size: 17px;
    font-weight: 300;
    line-height: 1.25;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tmd-field-group select::placeholder,
.tmd-field-group input[type="email"]::placeholder {
    color: #8f98a8;
}

.tmd-field-group select:hover,
.tmd-field-group input[type="email"]:hover {
    border-color: rgba(var(--tmd-accent-rgb), 0.35);
}

.tmd-field-group select:focus,
.tmd-field-group input[type="email"]:focus {
    outline: none;
    border-color: var(--tmd-accent);
    box-shadow: 0 0 0 3px rgba(var(--tmd-accent-rgb), 0.2);
}

.tmd-radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tmd-radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--tmd-border-strong);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    font-family: var(--tmd-font), sans-serif;
    font-size: 15px;
    font-weight: 500 !important;
}

.tmd-radio-label:hover {
    border-color: var(--tmd-accent);
    background: rgba(var(--tmd-accent-rgb), 0.06);
}

.tmd-radio-label input[type="radio"] {
    margin: 0;
    accent-color: var(--tmd-accent);
}

.tmd-radio-label input:checked + span,
.tmd-radio-label input:checked ~ span {
    color: var(--tmd-accent);
    font-weight: 600;
}

.tmd-hint {
    margin: 10px 0 0;
    color: var(--tmd-muted);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.4;
}

.tmd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    margin-top: 4px;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--tmd-accent);
    color: #fff;
    font-family: var(--tmd-font), sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.2s ease;
}

.tmd-btn:hover {
    transform: translateY(-1px);
    filter: brightness(0.95);
    box-shadow: 0 8px 22px rgba(var(--tmd-accent-rgb), 0.35);
}

.tmd-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tmd-btn-download {
    width: auto;
    min-width: 230px;
    margin: 0 auto;
    background: var(--tmd-accent);
}

.tmd-hidden {
    display: none !important;
}

.tmd-result {
    margin-top: 20px;
}

.tmd-success,
.tmd-error {
    border-radius: 14px;
    padding: 24px;
    border: 1px solid var(--tmd-border);
    animation: tmd-reveal 0.3s ease both;
}

.tmd-success {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(var(--tmd-accent-rgb), 0.11) 0%, rgba(var(--tmd-accent-rgb), 0.04) 100%);
    text-align: center;
}

.tmd-success::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(var(--tmd-accent-rgb), 0.65);
}

.tmd-success-kicker {
    margin: 0 0 10px;
    color: var(--tmd-accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.tmd-success-title,
.tmd-success h3 {
    margin: 0 0 8px;
    color: var(--tmd-heading);
    font-family: var(--tmd-font), sans-serif;
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-transform: none;
}

.tmd-success-subtitle,
.tmd-success p {
    margin: 8px 0;
    color: var(--tmd-text);
    font-size: 17px;
    font-weight: 300;
    line-height: 1.35;
}

.tmd-success-actions {
    margin: 16px 0 8px;
}

.tmd-email-note {
    margin-top: 12px;
    color: var(--tmd-muted);
    font-size: 14px;
    font-weight: 300;
}

.tmd-success-footnote {
    margin: 8px 0 0;
    color: var(--tmd-muted);
    font-size: 12px;
    line-height: 1.4;
}

.tmd-json-pw {
    display: inline-block;
    margin: 10px 0;
    padding: 10px 14px;
    border: 1px dashed rgba(var(--tmd-accent-rgb), 0.4);
    border-radius: 10px;
    background: #fff;
}

.tmd-json-pw code {
    color: var(--tmd-heading);
    font-size: 14px;
    letter-spacing: 0.02em;
}

.tmd-error {
    background: #fff7f8;
    border-color: #f0c8ce;
    color: #992338;
}

.tmd-error p {
    margin: 0;
    font-size: 16px;
}

@keyframes tmd-reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .tmd-download-wrapper {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .tmd-field-group label {
        font-size: 15px;
    }

    .tmd-field-group select,
    .tmd-field-group input[type="email"] {
        min-height: 48px;
        font-size: 16px;
    }

    .tmd-radio-group {
        flex-direction: column;
    }

    .tmd-radio-label {
        justify-content: flex-start;
        border-radius: 12px;
    }

    .tmd-success,
    .tmd-error {
        padding: 20px 16px;
    }

    .tmd-success-title,
    .tmd-success h3 {
        font-size: clamp(24px, 7vw, 30px);
    }

    .tmd-success-subtitle,
    .tmd-success p {
        font-size: 16px;
    }

    .tmd-btn,
    .tmd-btn-download {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tmd-btn,
    .tmd-field-group select,
    .tmd-field-group input[type="email"],
    .tmd-success,
    .tmd-error {
        transition: none;
        animation: none;
    }
}
