/* Shared utility */
.is-hidden {
    display: none !important;
}

/* Auth modal */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-modal.is-active {
    display: flex;
}

.auth-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    padding: 40px;
    animation: authModalSlideIn 0.3s ease;
}

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

.auth-modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-modal-header h2 {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 10px;
}

.auth-modal-header p {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.5;
}

.auth-benefits {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #374151;
    font-size: 14px;
}

.benefit-item:last-child {
    margin-bottom: 0;
}

.auth-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-auth {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-signup {
    background: #10b981;
    color: #ffffff;
}

.btn-signup:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.btn-login {
    background: #ffffff;
    color: #10b981;
    border: 2px solid #10b981;
}

.btn-login:hover {
    background: #f0fdf4;
    border-color: #059669;
}

.auth-divider {
    text-align: center;
    position: relative;
    margin: 10px 0;
    color: #9ca3af;
    font-size: 14px;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
    transform: translateY(-50%);
}

.auth-divider span {
    background: #ffffff;
    padding: 0 15px;
    position: relative;
}

/* Email verification modal */
.email-verification-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.email-verification-modal.is-active {
    display: flex;
}

.email-verification-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.email-verification-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    padding: 40px;
    animation: verificationModalSlideIn 0.3s ease;
}

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

.verification-icon {
    text-align: center;
    margin-bottom: 20px;
}

.verification-header {
    text-align: center;
    margin-bottom: 25px;
}

.verification-header h2 {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 10px;
}

.verification-header p {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.5;
}

.verification-info {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.email-display {
    font-size: 14px;
    color: #92400e;
    margin-bottom: 8px;
}

.user-email {
    font-size: 16px;
    color: #1f2937;
}

.verification-steps {
    margin-bottom: 30px;
}

.verification-steps h3 {
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 12px;
}

.verification-steps ol {
    margin: 0;
    padding-left: 20px;
}

.verification-steps li {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 8px;
    line-height: 1.5;
}

.verification-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.verification-actions button {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.btn-resend {
    background: #f59e0b;
    color: #ffffff;
}

.btn-resend:hover:not(:disabled) {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.btn-resend:disabled,
.btn-check-again:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.btn-check-again {
    background: #10b981;
    color: #ffffff;
}

.btn-check-again:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.btn-close-verification {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

.btn-close-verification:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.verification-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.verification-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.verification-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.verification-message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.heard-about-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.heard-about-modal.is-active {
    display: flex;
}

.heard-about-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.heard-about-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    max-width: 500px;
    width: 100%;
    padding: 40px;
    z-index: 1;
    animation: verificationModalSlideIn 0.25s ease;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    overscroll-behavior: contain; /* Prevent scroll chaining on mobile */
}

.heard-about-header {
    text-align: center;
    margin-bottom: 24px;
}

.heard-about-header h2 {
    font-size: 24px;
    color: #111827;
    margin-bottom: 8px;
}

.heard-about-header p {
    font-size: 15px;
    color: #6b7280;
}

.heard-about-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

/* Show/hide based on screen size */
.heard-about-mobile {
    display: none;
}

.heard-about-desktop {
    display: block;
}

.heard-about-options {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

/* Mobile select dropdown */
.heard-about-select-wrapper {
    margin-bottom: 16px;
}

.heard-about-select-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.heard-about-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: #1f2937;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    min-height: 44px;
}

.heard-about-select:focus {
    outline: 2px solid #10b981;
    outline-offset: 1px;
    border-color: #10b981;
}

.heard-about-select option {
    padding: 10px;
}

.heard-about-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease;
    font-size: 15px;
    color: #1f2937;
    min-height: 44px; /* Minimum touch target size for mobile */
}

.heard-about-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #10b981;
    margin: 0; /* Remove default margin for better alignment */
}

.heard-about-option:hover {
    border-color: #a7f3d0;
    background: #f0fdf4;
}

.heard-about-option:focus-within {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35);
    border-color: #34d399;
}

.heard-about-option.is-selected {
    border-color: #34d399;
    background: #ecfdf5;
}

.heard-about-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #065f46;
}

.heard-about-detail {
    margin-top: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.heard-about-detail label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.heard-about-detail textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: #1f2937;
    resize: vertical;
    min-height: 58px;
}

.heard-about-detail textarea:focus {
    outline: 2px solid #10b981;
    outline-offset: 1px;
}

.heard-about-error {
    font-size: 14px;
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 14px;
    margin: 8px 0 0;
}

.heard-about-error[hidden] {
    display: none;
}

.heard-about-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.heard-about-submit {
    background: #10b981;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px; /* Minimum touch target size for mobile */
}

.heard-about-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(16, 185, 129, 0.25);
    background: #0fb27a;
}

.heard-about-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Mobile-first responsive design for heard-about modal */

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 374px) {
    /* Switch to select dropdown on mobile */
    .heard-about-desktop {
        display: none;
    }

    .heard-about-mobile {
        display: block;
    }

    .heard-about-modal {
        padding: 8px;
        align-items: flex-start;
    }

    .heard-about-content {
        padding: 20px 16px;
        border-radius: 10px;
        margin-top: 16px;
        max-height: calc(100vh - 16px);
    }

    .heard-about-header {
        margin-bottom: 16px;
    }

    .heard-about-header h2 {
        font-size: 17px;
        line-height: 1.3;
    }

    .heard-about-header p {
        font-size: 12px;
        line-height: 1.4;
    }

    .heard-about-select-wrapper {
        margin-bottom: 12px;
    }

    .heard-about-select-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .heard-about-select {
        font-size: 14px;
        padding: 10px 12px;
        padding-right: 32px;
    }

    .heard-about-detail {
        padding: 9px 10px;
    }

    .heard-about-detail label {
        font-size: 12px;
    }

    .heard-about-detail textarea {
        font-size: 13px;
        padding: 8px 10px;
        min-height: 48px;
    }

    .heard-about-actions {
        margin-top: 16px;
    }

    .heard-about-submit {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
        min-height: 42px;
    }

    .heard-about-error {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* Small phones */
@media (min-width: 375px) and (max-width: 480px) {
    /* Switch to select dropdown on mobile */
    .heard-about-desktop {
        display: none;
    }

    .heard-about-mobile {
        display: block;
    }

    .heard-about-modal {
        padding: 12px;
        align-items: flex-start;
    }

    .heard-about-content {
        padding: 24px 20px;
        border-radius: 12px;
        margin-top: 20px;
        max-height: calc(100vh - 24px);
    }

    .heard-about-header {
        margin-bottom: 20px;
    }

    .heard-about-header h2 {
        font-size: 18px;
        line-height: 1.3;
    }

    .heard-about-header p {
        font-size: 13px;
    }

    .heard-about-select-wrapper {
        margin-bottom: 14px;
    }

    .heard-about-select-label {
        font-size: 13px;
    }

    .heard-about-select {
        font-size: 14px;
    }

    .heard-about-detail {
        padding: 10px 12px;
    }

    .heard-about-detail label {
        font-size: 13px;
    }

    .heard-about-detail textarea {
        font-size: 14px;
        padding: 9px 11px;
        min-height: 50px;
    }

    .heard-about-actions {
        margin-top: 20px;
    }

    .heard-about-submit {
        padding: 11px 24px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }

    .heard-about-error {
        font-size: 13px;
        padding: 9px 12px;
    }
}

@media (min-width: 481px) and (max-width: 600px) {
    /* Switch to select dropdown on small tablets */
    .heard-about-desktop {
        display: none;
    }

    .heard-about-mobile {
        display: block;
    }

    .heard-about-content {
        padding: 32px 28px;
    }

    .heard-about-header h2 {
        font-size: 21px;
    }

    .heard-about-header p {
        font-size: 14px;
    }

    .heard-about-select-label {
        font-size: 14px;
    }

    .heard-about-select {
        font-size: 15px;
    }
}

/* Landscape mobile devices */
@media (max-height: 600px) and (orientation: landscape) {
    .heard-about-modal {
        padding: 8px;
        align-items: flex-start;
    }

    .heard-about-content {
        padding: 20px 24px;
        margin-top: 8px;
        max-height: calc(100vh - 16px);
    }

    .heard-about-header {
        margin-bottom: 16px;
    }

    .heard-about-header h2 {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .heard-about-header p {
        font-size: 13px;
    }

    .heard-about-options {
        gap: 8px;
    }

    .heard-about-option {
        padding: 8px 10px;
    }

    .heard-about-actions {
        margin-top: 16px;
    }
}

@media (max-width: 640px) {
    .auth-modal-content,
    .email-verification-content {
        padding: 30px 20px;
    }

    .benefit-item,
    .verification-steps li {
        font-size: 13px;
    }
}
