/**
 * MBA Download Tool Styles
 *
 * Card component + modal form for Myrtle Beach Analysis executive summary download
 *
 * @package MPG_Sales_Core
 * @since 1.4.1
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --mpg-mba-primary: #3B7BBF;
    --mpg-mba-primary-light: #4A8ACC;
    --mpg-mba-accent: #3182ce;
    --mpg-mba-success: #38a169;
    --mpg-mba-error: #e53e3e;
    --mpg-mba-text: #2d3748;
    --mpg-mba-text-light: #718096;
    --mpg-mba-border: #e2e8f0;
    --mpg-mba-bg: #f7fafc;
    --mpg-mba-white: #ffffff;
    --mpg-mba-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    --mpg-mba-radius: 12px;
    --mpg-mba-transition: 0.3s ease;
}

/* ============================================
   Card Component
   ============================================ */
.mpg-mba-card {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 520px;
    margin: 0 auto;
    padding: 20px;
}

.mpg-mba-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--mpg-mba-white);
    border-radius: var(--mpg-mba-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--mpg-mba-border);
    transition: box-shadow var(--mpg-mba-transition);
    text-align: center;
}

.mpg-mba-card-inner:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.mpg-mba-card-image {
    width: 100%;
    padding: 32px 32px 0;
    box-sizing: border-box;
}

.mpg-mba-card-image img {
    width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.mpg-mba-card-content {
    padding: 24px 32px 32px;
}

.mpg-mba-card-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--mpg-mba-primary);
    margin: 0 0 8px;
    line-height: 1.3;
}

.mpg-mba-card-subtitle {
    font-size: 15px;
    color: var(--mpg-mba-text-light);
    margin: 0 0 24px;
    line-height: 1.6;
}

.mpg-mba-download-btn {
    background: var(--mpg-mba-primary);
    color: var(--mpg-mba-white);
    border: none;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--mpg-mba-transition);
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.mpg-mba-download-btn:hover {
    background: var(--mpg-mba-primary-light);
}

.mpg-mba-download-btn:active {
    background: #2f6aa8;
}

/* ============================================
   Modal Overlay
   ============================================ */
.mpg-mba-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--mpg-mba-transition), visibility var(--mpg-mba-transition);
    padding: 20px;
    overflow-y: auto;
}

.mpg-mba-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.mpg-mba-modal-open {
    overflow: hidden;
}

/* ============================================
   Modal Container
   ============================================ */
.mpg-mba-modal {
    background: var(--mpg-mba-white);
    border-radius: var(--mpg-mba-radius);
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: var(--mpg-mba-shadow);
    transform: translateY(20px);
    transition: transform var(--mpg-mba-transition);
    max-height: 90vh;
    overflow-y: auto;
}

.mpg-mba-modal-overlay.active .mpg-mba-modal {
    transform: translateY(0);
}

.mpg-mba-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--mpg-mba-bg);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: var(--mpg-mba-text-light);
    cursor: pointer;
    transition: all var(--mpg-mba-transition);
    z-index: 10;
}

.mpg-mba-modal-close:hover {
    background: var(--mpg-mba-border);
    color: var(--mpg-mba-text);
}

/* ============================================
   Form Container
   ============================================ */
.mpg-mba-form-container {
    padding: 32px;
}

.mpg-mba-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.mpg-mba-modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--mpg-mba-primary);
    margin: 0 0 8px;
}

.mpg-mba-modal-header p {
    font-size: 14px;
    color: var(--mpg-mba-text-light);
    margin: 0;
}

/* ============================================
   Form Elements
   ============================================ */
.mpg-mba-form-group {
    margin-bottom: 20px;
}

.mpg-mba-form-row {
    display: flex;
    gap: 16px;
}

.mpg-mba-form-half {
    flex: 1;
}

.mpg-mba-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--mpg-mba-text);
    margin-bottom: 6px;
}

.mpg-mba-form-group input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 2px solid var(--mpg-mba-border);
    border-radius: 8px;
    transition: border-color var(--mpg-mba-transition), box-shadow var(--mpg-mba-transition);
    background: var(--mpg-mba-white);
    color: var(--mpg-mba-text);
    font-family: inherit;
    box-sizing: border-box;
}

.mpg-mba-form-group input:focus {
    outline: none;
    border-color: var(--mpg-mba-accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.mpg-mba-form-group input.error {
    border-color: var(--mpg-mba-error);
}

.mpg-mba-form-group input::placeholder {
    color: var(--mpg-mba-text-light);
}

.mpg-mba-error-message {
    display: none;
    font-size: 12px;
    color: var(--mpg-mba-error);
    margin-top: 6px;
}

/* Honeypot */
.mpg-mba-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* ============================================
   Consent Checkbox
   ============================================ */
.mpg-mba-consent-group {
    margin-bottom: 24px;
}

.mpg-mba-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--mpg-mba-text);
    cursor: pointer;
    line-height: 1.5;
}

.mpg-mba-checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
    flex-shrink: 0;
}

/* ============================================
   Submit Button
   ============================================ */
.mpg-mba-submit-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--mpg-mba-white);
    background: linear-gradient(135deg, var(--mpg-mba-primary) 0%, var(--mpg-mba-primary-light) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--mpg-mba-transition);
    position: relative;
}

.mpg-mba-submit-btn:hover:not(:disabled) {
    box-shadow: 0 4px 15px rgba(59, 123, 191, 0.3);
    transform: translateY(-1px);
}

.mpg-mba-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.mpg-mba-submit-btn .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mpg-mba-submit-btn .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: mpg-mba-spin 0.8s linear infinite;
}

@keyframes mpg-mba-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Response States
   ============================================ */
.mpg-mba-response {
    padding: 48px 32px;
    text-align: center;
}

.mpg-mba-response-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
}

.mpg-mba-response h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--mpg-mba-text);
    margin: 0 0 12px;
}

.mpg-mba-response p {
    font-size: 15px;
    color: var(--mpg-mba-text-light);
    line-height: 1.6;
    margin: 0 0 12px;
}

.mpg-mba-response-note {
    font-size: 13px !important;
    font-style: italic;
}

/* Success State */
.mpg-mba-success .mpg-mba-response-icon {
    background: #c6f6d5;
    color: var(--mpg-mba-success);
}

/* Error State */
.mpg-mba-error .mpg-mba-response-icon {
    background: #fed7d7;
    color: var(--mpg-mba-error);
}

/* ============================================
   Response Buttons
   ============================================ */
.mpg-mba-close-btn {
    background: var(--mpg-mba-primary);
    color: var(--mpg-mba-white);
    border: none;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--mpg-mba-transition);
    margin-top: 8px;
}

.mpg-mba-close-btn:hover {
    background: var(--mpg-mba-primary-light);
}

.mpg-mba-retry-btn {
    background: var(--mpg-mba-accent);
    color: var(--mpg-mba-white);
    border: none;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--mpg-mba-transition);
    width: 100%;
}

.mpg-mba-retry-btn:hover:not(:disabled) {
    background: #2b6cb0;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .mpg-mba-card-content h2 {
        font-size: 20px;
    }

    .mpg-mba-card-image {
        padding: 24px 24px 0;
    }

    .mpg-mba-card-image img {
        width: 150px;
    }

    .mpg-mba-card-content {
        padding: 20px 24px 28px;
    }
}

@media (max-width: 600px) {
    .mpg-mba-modal {
        max-width: 100%;
        margin: 10px;
        max-height: calc(100vh - 40px);
    }

    .mpg-mba-form-container,
    .mpg-mba-response {
        padding: 24px 20px;
    }

    .mpg-mba-modal-header h3 {
        font-size: 20px;
    }

    .mpg-mba-form-row {
        flex-direction: column;
        gap: 0;
    }

    .mpg-mba-download-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}
