/* ==========================================================================
   EMAIL FORM - Component Styles
   ========================================================================== */

/* --- Email Form State --- */
#meet-email-form {
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease-out;
    background: linear-gradient(145deg, rgba(20, 20, 25, 0.97), rgba(35, 35, 45, 0.97));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#meet-panel.show-email-form #meet-email-form {
    opacity: 1;
    pointer-events: auto;
}

#meet-panel.show-email-form #meet-profile {
    opacity: 0;
    pointer-events: none;
}

/* --- Email Form Container --- */
.email-form-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    padding: 2.5rem;
    box-sizing: border-box;
}

/* --- Close Button --- */
.email-form-close {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: none;
    color: var(--color-white);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease-out;
}

.email-form-close:hover {
    opacity: 1;
}

/* --- Form Title --- */
.email-form-title {
    color: var(--color-white);
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 1.75rem;
    margin: 0 0 2rem 0;
    text-align: center;
    letter-spacing: 0.02em;
}

/* --- Form Styles --- */
.email-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--color-off-white);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
    background: var(--color-off-white);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    color: var(--color-dark);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-off-white);
    box-shadow: 0 0 0 2px rgba(226, 222, 217, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 250px;
}

/* --- Submit Button --- */
.email-submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    border: 1.8px solid var(--color-off-white);
    border-radius: 5px;
    padding: 1rem 2rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 0.2s ease-out, border-color 0.3s ease-out, opacity 0.2s ease-out;
    margin-top: 0.5rem;
}

.email-submit-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
}

.email-submit-button:active:not(:disabled) {
    box-shadow: inset 2px 6px 10px rgba(102, 74, 40, 0.25);
}

.email-submit-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Button icon (spinner/checkmark/cross) */
.button-icon {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    font-size: 1rem;
    line-height: 1;
}

/* Spinner animation for verifying state */
.email-submit-button.verifying .button-icon::after {
    content: '';
    display: block;
    width: 0.875rem;
    height: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Verified state - green */
.email-submit-button.verified {
    border-color: rgba(76, 175, 80, 0.8);
}

.email-submit-button.verified .button-icon::after {
    content: '✓';
    color: rgba(76, 175, 80, 0.9);
    animation: none;
    border: none;
}

/* Failed state - red */
.email-submit-button.failed {
    border-color: rgba(244, 67, 54, 0.8);
}

.email-submit-button.failed .button-icon::after {
    content: '✕';
    color: rgba(244, 67, 54, 0.9);
    animation: none;
    border: none;
}

/* Sending state */
.email-submit-button.sending .button-icon::after {
    content: '';
    display: block;
    width: 0.875rem;
    height: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Sent state - green success */
.email-submit-button.sent {
    border-color: rgba(76, 175, 80, 0.8);
    background: rgba(76, 175, 80, 0.15);
}

.email-submit-button.sent .button-icon::after {
    content: '✓';
    color: rgba(76, 175, 80, 1);
    animation: none;
    border: none;
}

/* --- Mobile Layout (≤820px) --- */
@media (max-width: 820px) {
    .email-form-container {
        padding: 1.5rem;
        max-width: 100%;
    }

    .email-form-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .form-group textarea {
        resize: vertical;
        min-height: clamp(50px, 15vh, 250px);
    }

    .email-form-close {
        top: 1rem;
        right: 0.5rem;
    }
}

/* --- Turnstile Badge --- */
.turnstile-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s ease-out;
}

.turnstile-badge-icon {
    width: 0.875rem;
    height: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.turnstile-badge-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.02em;
}
