/**
 * SimuBrick — Email Capture Styles
 * =================================
 * Glassmorphism modal with smooth animations.
 * Used by js/email-capture.js
 */

/* ===== Overlay ===== */
.email-capture-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.email-capture-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== Modal Card ===== */
.email-capture-modal {
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 440px;
    width: 100%;
    padding: 32px;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.email-capture-overlay.active .email-capture-modal {
    transform: translateY(0) scale(1);
}

/* ===== Close Button ===== */
.email-capture-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    font-size: 18px;
    color: #6b7280;
    line-height: 1;
}

.email-capture-close:hover {
    background: #e5e7eb;
    transform: scale(1.1);
}

/* ===== Header ===== */
.email-capture-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #116b76, #5dc7c3);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
}

.email-capture-title {
    font-size: 22px;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 8px;
    line-height: 1.3;
}

.email-capture-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ===== Form ===== */
.email-capture-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.email-capture-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.email-capture-input:focus {
    border-color: #116b76;
    box-shadow: 0 0 0 3px rgba(17, 107, 118, 0.1);
}

.email-capture-input::placeholder {
    color: #9ca3af;
}

.email-capture-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #116b76, #22999f);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    font-family: inherit;
}

.email-capture-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(17, 107, 118, 0.3);
}

.email-capture-submit:active {
    transform: translateY(0);
}

.email-capture-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== RGPD Notice ===== */
.email-capture-rgpd {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    margin-top: 12px;
    line-height: 1.5;
}

.email-capture-rgpd a {
    color: #116b76;
    text-decoration: underline;
}

/* ===== Success State ===== */
.email-capture-success {
    text-align: center;
    padding: 20px 0;
}

.email-capture-success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.email-capture-success-title {
    font-size: 20px;
    font-weight: 700;
    color: #116b76;
    margin: 0 0 8px;
}

.email-capture-success-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* ===== Error State ===== */
.email-capture-error {
    background: #fef2f2;
    color: #dc2626;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.email-capture-error.visible {
    display: block;
}

/* ===== Loading Spinner ===== */
.email-capture-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: email-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* ===== Benefits List ===== */
.email-capture-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.email-capture-benefits li {
    padding: 6px 0;
    font-size: 14px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.email-capture-benefits li::before {
    content: '✓';
    color: #116b76;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .email-capture-modal {
        padding: 24px;
        border-radius: 20px;
    }

    .email-capture-title {
        font-size: 19px;
    }
}

/* ===== Inline Email CTA ===== */
.ec-inline {
    transition: opacity 0.3s ease, max-height 0.4s ease;
}

.ec-inline.hidden {
    display: none;
}

.ec-inline-box {
    background: linear-gradient(135deg, rgba(17, 107, 118, 0.04), rgba(93, 199, 195, 0.08));
    border: 1px solid rgba(17, 107, 118, 0.15);
    border-radius: 14px;
    padding: 14px 18px;
}

.ec-inline-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ec-inline-label {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
}

.ec-inline-form {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 220px;
}

.ec-inline-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 0;
}

.ec-inline-input:focus {
    border-color: #116b76;
    box-shadow: 0 0 0 2px rgba(17, 107, 118, 0.1);
}

.ec-inline-btn {
    padding: 8px 18px;
    background: linear-gradient(135deg, #116b76, #22999f);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.ec-inline-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 107, 118, 0.25);
}

.ec-inline-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ec-inline-feedback {
    font-size: 13px;
    margin-top: 6px;
    min-height: 0;
    transition: all 0.2s;
}

.ec-inline-success {
    color: #059669;
    font-weight: 500;
}

.ec-inline-error {
    color: #dc2626;
    font-weight: 500;
}

.ec-inline-rgpd {
    font-size: 11px;
    color: #9ca3af;
    margin: 6px 0 0;
}

.ec-inline-rgpd a {
    color: #116b76;
    text-decoration: underline;
}

@media (max-width: 480px) {
    .ec-inline-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ec-inline-form {
        min-width: 0;
    }
}
