/* MTF Popups - Frontend Styles */

:root {
    --mtf-popup-orange: #ffcc00;
    --mtf-popup-dark: #0a0a0a;
    --mtf-popup-gray: #1a1a1a;
    --mtf-popup-input-bg: #141414;
    --mtf-popup-input-border: #2a2a2a;
    --mtf-popup-radius: 32px;
}

/* Animations */
@keyframes mtfFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Overlay */
.mtf-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.mtf-popup-overlay.mtf-popup-visible {
    display: flex;
    opacity: 1;
}

/* Content wrapper (injected by JS around .mtf-popup-modal) */
.mtf-popup-content {
    width: 100%;
    max-width: 64rem;
    max-height: calc(100vh - 40px);
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: var(--mtf-popup-radius);
    animation: mtfSlideUp 0.4s ease forwards;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

/* Two-column grid layout - the modal itself */
.mtf-popup-modal {
    display: grid;
    min-height: 340px;
    grid-template-columns: 1fr 1fr;
    position: relative;
}

/* Close button */
.mtf-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
    padding: 0;
    color: #fff;
}

.mtf-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mtf-popup-close svg {
    width: 14px;
    height: 14px;
}

/* Left column - Image */
.mtf-popup-left {
    position: relative;
    overflow: hidden;
    min-height: 340px;
}

.mtf-popup-left img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 85% center;
}

.mtf-popup-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    z-index: 1;
}

.mtf-popup-left-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    z-index: 2;
}

/* Badge */
.mtf-popup-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--mtf-popup-orange);
    color: #fff;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    margin-bottom: 16px;
}

.mtf-popup-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    display: inline-block;
}

.mtf-popup-title {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin: 0 0 12px 0;
}

.mtf-popup-description {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin: 0;
}

/* Right column - Form */
.mtf-popup-right {
    background: var(--mtf-popup-dark);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Decorative background icon */
.mtf-popup-right-icon {
    position: absolute;
    top: -20px;
    right: -20px;
    opacity: 1;
    pointer-events: none;
}

/* Form container */
.mtf-popup-form-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.mtf-popup-form-title {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
}

.mtf-popup-form-subtitle {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 24px 0;
}

/* Form elements */
.mtf-popup-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Name row - side by side */
.mtf-popup-name-row {
    display: flex;
    gap: 12px;
}

.mtf-popup-name-row .mtf-popup-input-group {
    flex: 1;
}

/* Input group (icon + input) */
.mtf-popup-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.mtf-popup-input-group svg {
    position: absolute;
    left: 16px;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 1;
}

.mtf-popup-input-group input[type="text"],
.mtf-popup-input-group input[type="email"],
.mtf-popup-input-group input[type="tel"] {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--mtf-popup-input-bg);
    border: 1px solid var(--mtf-popup-input-border);
    border-radius: 12px;
    color: #fff;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.mtf-popup-input-group input:focus {
    border-color: var(--mtf-popup-orange);
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.15);
}

.mtf-popup-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Consent checkbox */
.mtf-popup-consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.mtf-popup-consent input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background: var(--mtf-popup-input-bg);
    border: 1px solid var(--mtf-popup-input-border);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease;
    margin: 0;
    flex-shrink: 0;
}

.mtf-popup-consent input[type="checkbox"]:checked {
    background: var(--mtf-popup-orange);
    border-color: var(--mtf-popup-orange);
}

.mtf-popup-consent input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.mtf-popup-consent label {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    cursor: pointer;
}

.mtf-popup-consent a {
    color: var(--mtf-popup-orange);
    text-decoration: none;
}

.mtf-popup-consent a:hover {
    text-decoration: underline;
}

/* Submit button */
.mtf-popup-submit {
    position: relative;
    width: 100%;
    padding: 16px 32px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 9999px;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: color 0.3s ease;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mtf-popup-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--mtf-popup-orange);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 0;
}

.mtf-popup-submit span,
.mtf-popup-submit svg {
    position: relative;
    z-index: 1;
}

.mtf-popup-submit:hover {
    color: #fff;
}

.mtf-popup-submit:hover::before {
    transform: scaleX(1);
}

.mtf-popup-submit:hover svg {
    stroke: #fff;
}

.mtf-popup-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Footer */
.mtf-popup-footer {
    margin-top: 20px;
    text-align: center;
}

.mtf-popup-footer p {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

.mtf-popup-footer a {
    color: var(--mtf-popup-orange);
    text-decoration: none;
}

.mtf-popup-footer a:hover {
    text-decoration: underline;
}

/* Success state */
.mtf-popup-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    animation: mtfFadeIn 0.4s ease;
}

.mtf-popup-success svg {
    color: var(--mtf-popup-orange);
    margin-bottom: 20px;
}

.mtf-popup-success p {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin: 0;
}

/* Error state */
.mtf-popup-error {
    background: rgba(220, 53, 69, 0.15);
    color: #ff6b6b;
    padding: 10px 16px;
    border-radius: 9999px;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    text-align: center;
    animation: mtfFadeIn 0.3s ease;
}

/* Privacy note */
.mtf-popup-privacy {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    margin-top: 16px;
}

.mtf-popup-privacy a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: underline;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .mtf-popup-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .mtf-popup-content {
        max-height: 95vh;
        overflow-y: auto;
        border-radius: 24px;
    }

    .mtf-popup-modal {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .mtf-popup-left {
        min-height: 220px;
    }

    .mtf-popup-left-content {
        padding: 20px;
    }

    .mtf-popup-title {
        font-size: 22px;
    }

    .mtf-popup-description {
        font-size: 13px;
    }

    .mtf-popup-right {
        padding: 24px;
    }

    .mtf-popup-form-title {
        font-size: 18px;
    }

    .mtf-popup-input-group input[type="text"],
    .mtf-popup-input-group input[type="email"],
    .mtf-popup-input-group input[type="tel"] {
        padding: 12px 14px 12px 40px;
        font-size: 14px;
    }

    .mtf-popup-submit {
        padding: 14px 24px;
        font-size: 14px;
    }

    .mtf-popup-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .mtf-popup-name-row {
        flex-direction: column;
    }
}
