/* ==========================================================================
   Design System & Layout - Dark Theme Form
   ========================================================================== */
.mg-td-form-container {
    --mg-td-bg: #111111;
    --mg-td-card-bg: #181818;
    --mg-td-text: #ffffff;
    --mg-td-text-muted: #aaaaaa;
    --mg-td-border: #ffffff;
    --mg-td-border-muted: rgba(255, 255, 255, 0.35);
    --mg-td-focus: #ffffff;
    --mg-td-error: #ff4d4d;
    --mg-td-success: #00b050;
    --mg-td-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    width: 100%;
    max-width: 960px;
    margin: 2rem auto;
    background-color: var(--mg-td-bg);
    color: var(--mg-td-text);
    padding: 3rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    font-family: 'Outfit', sans-serif;
    box-sizing: border-box;
}

.mg-td-form-container * {
    box-sizing: border-box;
}

/* ==========================================================================
   Step Indicators Header
   ========================================================================== */
.mg-td-steps-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.mg-td-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.35;
    transition: var(--mg-td-transition);
}

.mg-td-step-indicator.active {
    opacity: 1;
}

.mg-td-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--mg-td-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 15px;
    background-color: var(--mg-td-bg);
    color: var(--mg-td-text);
}

.mg-td-step-indicator.active .mg-td-step-num {
    background-color: var(--mg-td-border);
    color: var(--mg-td-bg);
}

.mg-td-step-text {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mg-td-step-line {
    height: 1.5px;
    width: 80px;
    background-color: var(--mg-td-border-muted);
}

/* ==========================================================================
   Typography
   ========================================================================== */
.mg-td-title {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-top: 0;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mg-td-text);
}

.mg-td-subtitle {
    font-size: 1.05rem;
    color: var(--mg-td-text-muted);
    text-align: center;
    line-height: 1.5;
    max-width: 720px;
    margin: 0 auto 2.5rem auto;
}

/* ==========================================================================
   Step Section Switch logic
   ========================================================================== */
.mg-td-step-section {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.mg-td-step-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Form Fields styling
   ========================================================================== */
.mg-td-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    color: var(--mg-td-text);
}

.mg-td-input,
.mg-td-select {
    width: 100%;
    height: 52px;
    background-color: var(--mg-td-bg);
    border: 1.5px solid var(--mg-td-border-muted);
    border-radius: 4px;
    padding: 0 16px;
    font-size: 15px;
    color: var(--mg-td-text);
    font-family: inherit;
    transition: var(--mg-td-transition);
    outline: none;
}

/* Dropdown styling */
.mg-td-select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='white'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 24px;
    padding-right: 40px;
}

.mg-td-select optgroup {
    background-color: #222;
    color: var(--mg-td-text);
    font-weight: 600;
    font-style: normal;
}

.mg-td-select option {
    background-color: var(--mg-td-bg);
    color: var(--mg-td-text);
}

/* Fields Hover/Focus */
.mg-td-input:focus,
.mg-td-select:focus {
    border-color: var(--mg-td-focus);
    box-shadow: 0 0 0 1px var(--mg-td-focus);
}

.mg-td-input::placeholder {
    color: #666;
}

/* Validation Errors styling */
.mg-td-input.invalid,
.mg-td-select.invalid {
    border-color: var(--mg-td-error) !important;
}

/* ==========================================================================
   Step 1 Custom styles
   ========================================================================== */
.mg-td-select-wrapper {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.mg-td-select-wrapper .mg-td-label {
    text-align: left;
    font-size: 13px;
}

/* ==========================================================================
   Step 2 Custom styles & Form Grid
   ========================================================================== */
.mg-td-selected-badge-row {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.mg-td-selected-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--mg-td-border-muted);
    border-radius: 30px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.mg-td-remove-badge {
    background: none;
    border: none;
    color: var(--mg-td-text);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.mg-td-remove-badge:hover {
    opacity: 0.65;
}

/* Form Grid */
.mg-td-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem 2rem;
    margin-bottom: 2rem;
}

/* Whatsapp split column */
.mg-td-whatsapp-group {
    display: flex;
    gap: 12px;
}

.mg-td-wsp-country {
    flex: 0 0 130px;
}

.mg-td-wsp-num {
    flex: 1;
}

/* Policies checks */
.mg-td-policies-section {
    border-top: 1px solid var(--mg-td-border-muted);
    padding-top: 1.75rem;
    margin-bottom: 2rem;
}

.mg-td-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
    color: var(--mg-td-text-muted);
}

.mg-td-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
    accent-color: var(--mg-td-border);
}

.mg-td-checkbox-label a.mg-td-link {
    color: var(--mg-td-text);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.mg-td-checkbox-label a.mg-td-link:hover {
    opacity: 0.8;
}

/* ==========================================================================
   Submit Row & Spinner
   ========================================================================== */
.mg-td-submit-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mg-td-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--mg-td-text);
    border-radius: 50%;
    animation: mg-td-spin 0.8s linear infinite;
}

@keyframes mg-td-spin {
    to { transform: rotate(360deg); }
}

/* Buttons */
.mg-td-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 2.5rem;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--mg-td-transition);
    text-decoration: none;
}

.mg-td-btn-solid {
    background-color: var(--mg-td-border);
    color: var(--mg-td-bg);
    border: 1px solid var(--mg-td-border);
}

.mg-td-btn-solid:hover {
    background-color: transparent;
    color: var(--mg-td-text);
}

.mg-td-btn-outline {
    background-color: transparent;
    color: var(--mg-td-text);
    border: 1px solid var(--mg-td-border);
}

.mg-td-btn-outline:hover {
    background-color: var(--mg-td-border);
    color: var(--mg-td-bg);
}

/* Error message list box */
.mg-td-error-box {
    background-color: rgba(255, 77, 77, 0.1);
    border-left: 4px solid var(--mg-td-error);
    padding: 12px 16px;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: #ffb3b3;
}

/* ==========================================================================
   Step 3 success confirmation layout
   ========================================================================== */
.mg-td-success-icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.mg-td-success-icon {
    width: 72px;
    height: 72px;
    fill: var(--mg-td-success);
}

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

/* ==========================================================================
   Responsive Grid
   ========================================================================== */
@media (max-width: 768px) {
    .mg-td-form-container {
        padding: 2rem 1.5rem;
        margin: 1rem auto;
    }
    
    .mg-td-form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .mg-td-title {
        font-size: 1.75rem;
    }
    
    .mg-td-btn {
        width: 100%;
    }
    
    .mg-td-submit-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mg-td-spinner {
        margin: 0 auto;
    }
    
    .mg-td-steps-header {
        margin-bottom: 2rem;
    }
    
    .mg-td-step-line {
        width: 40px;
    }
}
