/**
 * WSTTM Registration Components
 * Shared styles for the locked results overlay and registration modal
 * Used on SSS (stopsendingspam.com) and MPL (messageproviderlookup.com)
 */

/* =============================================================================
   Locked Results Overlay
   Shown after first free lookup to prompt WSTTM registration
   ============================================================================= */

.locked-results-container {
    position: relative;
    margin-top: 1.5rem;
}

/* The blurred results behind the overlay */

.locked-results-blur {
    filter: blur(8px);
    opacity: 0.6;
    pointer-events: none;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
}

/* The overlay card */

.locked-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    text-align: center;
    z-index: 10;
}

/* Phone number display at top */

.locked-overlay__phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    color: var(--color-text, #111827);
}

.locked-overlay__phone-icon {
    font-size: 1.5rem;
}

/* Lock icon */

.locked-overlay__lock {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Headline */

.locked-overlay__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    color: var(--color-text, #111827);
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

/* Subtext */

.locked-overlay__subtitle {
    font-size: 1rem;
    color: #6b7280;
    color: var(--color-text-secondary, #6b7280);
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

/* WSTTM branding/explanation */

.locked-overlay__wsttm-note {
    font-size: 0.875rem;
    color: #6b7280;
    color: var(--color-text-secondary, #6b7280);
    margin: 0 0 1.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    background: var(--color-bg-subtle, #f9fafb);
    border-radius: 8px;
}

.locked-overlay__wsttm-note a {
    color: #2563eb;
    color: var(--color-primary, #2563eb);
    text-decoration: none;
    font-weight: 500;
}

.locked-overlay__wsttm-note a:hover {
    text-decoration: underline;
}

/* Primary CTA button */

.locked-overlay__btn-primary {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: 0.75rem;
}

.locked-overlay__btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.locked-overlay__btn-primary:active {
    transform: translateY(0);
}

/* Divider */

.locked-overlay__divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    color: #9ca3af;
    color: var(--color-text-tertiary, #9ca3af);
    font-size: 0.875rem;
}

.locked-overlay__divider::before,
.locked-overlay__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
    background: var(--color-border, #e5e7eb);
}

.locked-overlay__divider span {
    padding: 0 0.75rem;
}

/* Google OAuth button */

.locked-overlay__btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    color: var(--color-text, #111827);
    background: white;
    border: 1px solid #e5e7eb;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.locked-overlay__btn-google:hover {
    background: #f9fafb;
    background: var(--color-bg-subtle, #f9fafb);
    border-color: #d1d5db;
    border-color: var(--color-border-hover, #d1d5db);
}

.locked-overlay__btn-google svg {
    width: 18px;
    height: 18px;
}

/* =============================================================================
   Registration Modal
   Email registration form that calls WSTTM API
   ============================================================================= */

.wsttm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.wsttm-modal.active {
    display: flex;
}

.wsttm-modal__content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.wsttm-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    border: none;
    background: #f3f4f6;
    background: var(--color-bg-subtle, #f3f4f6);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    color: #6b7280;
    color: var(--color-text-secondary, #6b7280);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.wsttm-modal__close:hover {
    background: #e5e7eb;
    background: var(--color-bg-hover, #e5e7eb);
}

.wsttm-modal__header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.wsttm-modal__logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 1rem;
}

.wsttm-modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    color: var(--color-text, #111827);
    margin: 0 0 0.5rem;
}

.wsttm-modal__subtitle {
    font-size: 1rem;
    color: #6b7280;
    color: var(--color-text-secondary, #6b7280);
    margin: 0;
}

.wsttm-modal__body {
    padding: 1rem 2rem 2rem;
}

/* Email form */

.wsttm-form__group {
    margin-bottom: 1rem;
}

.wsttm-form__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    color: var(--color-text, #111827);
    margin-bottom: 0.5rem;
}

.wsttm-form__input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 1px solid #e5e7eb;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wsttm-form__input:focus {
    outline: none;
    border-color: #2563eb;
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wsttm-form__input.error {
    border-color: #dc2626;
    border-color: var(--color-error, #dc2626);
}

.wsttm-form__error {
    font-size: 0.875rem;
    color: #dc2626;
    color: var(--color-error, #dc2626);
    margin-top: 0.5rem;
    display: none;
}

.wsttm-form__error.visible {
    display: block;
}

.wsttm-form__submit {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wsttm-form__submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.wsttm-form__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.wsttm-form__submit.loading {
    position: relative;
    color: transparent;
}

.wsttm-form__submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.25rem;
    height: 1.25rem;
    margin: -0.625rem 0 0 -0.625rem;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: wsttm-spinner 0.8s linear infinite;
}

@keyframes wsttm-spinner {
    to { transform: rotate(360deg); }
}

/* =============================================================================
   Success State
   Shown after successful email registration
   ============================================================================= */

.wsttm-success {
    text-align: center;
    padding: 2rem;
}

.wsttm-success__icon {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.wsttm-success__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    color: var(--color-text, #111827);
    margin: 0 0 0.5rem;
}

.wsttm-success__message {
    font-size: 1rem;
    color: #6b7280;
    color: var(--color-text-secondary, #6b7280);
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.wsttm-success__btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wsttm-success__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* =============================================================================
   Responsive Adjustments
   ============================================================================= */

@media (max-width: 480px) {
    .locked-overlay {
        padding: 1.5rem;
    }

    .locked-overlay__title {
        font-size: 1.25rem;
    }

    .locked-overlay__lock {
        font-size: 2.5rem;
    }

    .wsttm-modal__content {
        max-height: 95vh;
    }

    .wsttm-modal__header,
    .wsttm-modal__body {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}
