/**
 * Login Modal CSS - Isolated
 *
 * Modal de login/registro moderno e responsivo.
 * CSS totalmente isolado para evitar conflitos com temas.
 *
 * @package TUH_Account
 * @since 3.1.0
 * @updated 3.2.0 - CSS Isolation
 */

/* ===========================================
   SCOPED RESET
   =========================================== */
.tuh-modal,
.tuh-modal *,
.tuh-modal *::before,
.tuh-modal *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===========================================
   VARIABLES (Scoped to .tuh-modal)
   =========================================== */
.tuh-modal {
    /* Colors - Light Theme (default) */
    --tuh-modal-bg: #ffffff;
    --tuh-modal-backdrop: rgba(0, 0, 0, 0.6);
    --tuh-modal-border: #e5e7eb;
    --tuh-modal-text: #111827;
    --tuh-modal-text-secondary: #4b5563;
    --tuh-modal-text-muted: #6b7280;
    --tuh-modal-primary: #2563eb;
    --tuh-modal-primary-hover: #1d4ed8;
    --tuh-modal-input-bg: #f9fafb;
    --tuh-modal-input-border: #d1d5db;
    --tuh-modal-input-focus: rgba(37, 99, 235, 0.3);
    --tuh-modal-success: #16a34a;
    --tuh-modal-error: #dc2626;
    --tuh-modal-radius: 16px;
    --tuh-modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Z-Index Scale (reasonable values) */
    --tuh-modal-z-backdrop: 1000;
    --tuh-modal-z-container: 1001;
    --tuh-modal-z-close: 1002;
}

/* Dark mode support - scoped */
@media (prefers-color-scheme: dark) {
    .tuh-modal {
        --tuh-modal-bg: #18181b;
        --tuh-modal-border: #27272a;
        --tuh-modal-text: #fafafa;
        --tuh-modal-text-secondary: #a1a1aa;
        --tuh-modal-text-muted: #a1a1aa; /* Increased from #71717a for better contrast (4.5:1) */
        --tuh-modal-input-bg: #27272a;
        --tuh-modal-input-border: #3f3f46;
    }
}

/* Manual dark mode class override */
.tuh-modal.tuh-modal--dark {
    --tuh-modal-bg: #18181b;
    --tuh-modal-border: #27272a;
    --tuh-modal-text: #fafafa;
    --tuh-modal-text-secondary: #a1a1aa;
    --tuh-modal-text-muted: #a1a1aa;
    --tuh-modal-input-bg: #27272a;
    --tuh-modal-input-border: #3f3f46;
}

/* ===========================================
   MODAL BASE
   =========================================== */
.tuh-modal {
    position: fixed;
    inset: 0;
    z-index: var(--tuh-modal-z-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--tuh-modal-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tuh-modal.active {
    opacity: 1;
    visibility: visible;
}

/* ===========================================
   BACKDROP
   =========================================== */
.tuh-modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--tuh-modal-backdrop);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ===========================================
   CONTAINER
   =========================================== */
.tuh-modal-container {
    position: relative;
    z-index: var(--tuh-modal-z-container);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--tuh-modal-bg);
    border-radius: var(--tuh-modal-radius);
    box-shadow: var(--tuh-modal-shadow);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
}

.tuh-modal.active .tuh-modal-container {
    transform: translateY(0);
    opacity: 1;
}

/* Animation: slide-up (default) */
.tuh-modal[data-animation="slide-up"] .tuh-modal-container {
    transform: translateY(40px);
}
.tuh-modal[data-animation="slide-up"].active .tuh-modal-container {
    transform: translateY(0);
}

/* Animation: scale */
.tuh-modal[data-animation="scale"] .tuh-modal-container {
    transform: scale(0.9);
}
.tuh-modal[data-animation="scale"].active .tuh-modal-container {
    transform: scale(1);
}

/* Animation: fade */
.tuh-modal[data-animation="fade"] .tuh-modal-container {
    transform: none;
}

/* ===========================================
   CLOSE BUTTON
   =========================================== */
.tuh-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: var(--tuh-modal-z-close);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--tuh-modal-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tuh-modal-close:hover {
    background: var(--tuh-modal-input-bg);
    color: var(--tuh-modal-text);
}

.tuh-modal-close svg {
    width: 18px;
    height: 18px;
}

/* ===========================================
   HEADER
   =========================================== */
.tuh-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 32px 0;
}

.tuh-modal-logo {
    max-height: 40px;
    width: auto;
}

.tuh-modal-logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--tuh-modal-primary), #6366f1);
    border-radius: 12px;
}

.tuh-modal-logo-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.tuh-modal-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--tuh-modal-text);
}

/* ===========================================
   TABS
   =========================================== */
.tuh-modal-tabs {
    display: flex;
    margin: 24px 32px 0;
    border-bottom: 1px solid var(--tuh-modal-border);
}

.tuh-modal-tab {
    flex: 1;
    padding: 14px 0;
    min-height: 44px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tuh-modal-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.tuh-modal-tab:hover {
    color: var(--tuh-modal-text-secondary);
}

.tuh-modal-tab.active {
    color: var(--tuh-modal-primary);
    border-bottom-color: var(--tuh-modal-primary);
}

/* ===========================================
   PANELS
   =========================================== */
.tuh-modal-panel {
    display: none;
    padding: 28px 32px 32px;
    animation: tuh-modal-fade 0.3s ease;
}

.tuh-modal-panel.active {
    display: block;
}

@keyframes tuh-modal-fade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   PANEL HEADER (Split template)
   =========================================== */
.tuh-modal-panel-header {
    text-align: center;
    margin-bottom: 24px;
}

.tuh-modal-panel-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--tuh-modal-text);
    margin: 0 0 6px 0;
}

.tuh-modal-panel-header p {
    font-size: 0.9rem;
    color: var(--tuh-modal-text-secondary);
    margin: 0;
}

/* ===========================================
   SECURITY BADGE (Split template)
   =========================================== */
.tuh-modal-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--tuh-modal-border);
    font-size: 0.8rem;
    color: var(--tuh-modal-text-muted);
}

.tuh-modal-security svg {
    width: 16px;
    height: 16px;
    color: var(--tuh-modal-success);
}

/* ===========================================
   TITLE & SUBTITLE
   =========================================== */
.tuh-modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--tuh-modal-text);
    margin: 0 0 6px 0;
    text-align: center;
}

.tuh-modal-subtitle {
    font-size: 0.9rem;
    color: var(--tuh-modal-text-secondary);
    margin: 0 0 24px 0;
    text-align: center;
}

/* ===========================================
   SOCIAL LOGIN
   =========================================== */
.tuh-modal-social {
    margin-bottom: 20px;
}

.tuh-modal-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    min-height: 44px;
    background: var(--tuh-modal-input-bg);
    border: 1px solid var(--tuh-modal-border);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--tuh-modal-text);
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tuh-modal-social-btn:hover {
    background: var(--tuh-modal-border);
}

.tuh-modal-social-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Social Button Variants */
.tuh-modal-social-google:hover {
    border-color: #4285f4;
    background: rgba(66, 133, 244, 0.05);
}

.tuh-modal-social-facebook {
    background: #1877F2;
    border-color: #1877F2;
    color: #fff;
}

.tuh-modal-social-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
    color: #fff;
}

.tuh-modal-social-facebook svg {
    fill: currentColor;
}

/* ===========================================
   DIVIDER
   =========================================== */
.tuh-modal-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.tuh-modal-divider::before,
.tuh-modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--tuh-modal-border);
}

.tuh-modal-divider span {
    font-size: 0.8rem;
    color: var(--tuh-modal-text-muted);
}

/* ===========================================
   FORM
   =========================================== */
.tuh-modal-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tuh-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 400px) {
    .tuh-modal-row {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   FIELD
   =========================================== */
.tuh-modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tuh-modal-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tuh-modal-text);
}

.tuh-modal-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tuh-modal-forgot {
    font-size: 0.8rem;
    color: var(--tuh-modal-primary);
    text-decoration: none;
}

.tuh-modal-forgot:hover {
    text-decoration: underline;
}

.tuh-modal-field input {
    width: 100%;
    padding: 12px 14px;
    min-height: 44px;
    background: var(--tuh-modal-input-bg);
    border: 1px solid var(--tuh-modal-input-border);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--tuh-modal-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tuh-modal-field input::placeholder {
    color: var(--tuh-modal-text-muted);
}

.tuh-modal-field input:focus {
    outline: none;
    border-color: var(--tuh-modal-primary);
    box-shadow: 0 0 0 3px var(--tuh-modal-input-focus);
}

/* Input Wrapper (password + icons) */
.tuh-modal-input-wrapper {
    position: relative;
}

.tuh-modal-input-wrapper input {
    padding-right: 44px;
}

/* Input com ícone à esquerda */
.tuh-modal-input-wrapper:has(.tuh-modal-input-icon) input {
    padding-left: 44px;
}

/* Ícone dentro do input */
.tuh-modal-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--tuh-modal-text-muted);
    pointer-events: none;
}

.tuh-modal-toggle-password {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tuh-modal-text-muted);
    cursor: pointer;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tuh-modal-toggle-password:hover {
    color: var(--tuh-modal-text-secondary);
}

.tuh-modal-toggle-password svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ===========================================
   CHECKBOX
   =========================================== */
.tuh-modal-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--tuh-modal-text-secondary);
    cursor: pointer;
}

.tuh-modal-checkbox input {
    margin-top: 2px;
    accent-color: var(--tuh-modal-primary);
}

.tuh-modal-checkbox a {
    color: var(--tuh-modal-primary);
    text-decoration: none;
}

.tuh-modal-checkbox a:hover {
    text-decoration: underline;
}

/* ===========================================
   SUBMIT BUTTON
   =========================================== */
.tuh-modal-submit {
    width: 100%;
    padding: 14px 20px;
    min-height: 44px;
    background: var(--tuh-modal-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    -webkit-tap-highlight-color: transparent;
}

.tuh-modal-submit:hover:not(:disabled) {
    background: var(--tuh-modal-primary-hover);
    transform: translateY(-1px);
}

.tuh-modal-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner */
.tuh-spinner {
    width: 20px;
    height: 20px;
    animation: tuh-spin 1s linear infinite;
}

@keyframes tuh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===========================================
   MESSAGES
   =========================================== */
.tuh-modal-messages {
    margin-bottom: 0;
}

.tuh-modal-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.tuh-modal-message.success {
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.2);
    color: var(--tuh-modal-success);
}

.tuh-modal-message.error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: var(--tuh-modal-error);
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 480px) {
    .tuh-modal-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .tuh-modal-header {
        padding: 24px 20px 0;
    }

    .tuh-modal-tabs {
        margin: 20px 20px 0;
    }

    .tuh-modal-panel {
        padding: 24px 20px;
    }
}

/* ===========================================
   SCROLLBAR
   =========================================== */
.tuh-modal-container::-webkit-scrollbar {
    width: 6px;
}

.tuh-modal-container::-webkit-scrollbar-track {
    background: transparent;
}

.tuh-modal-container::-webkit-scrollbar-thumb {
    background: var(--tuh-modal-border);
    border-radius: 3px;
}

.tuh-modal-container::-webkit-scrollbar-thumb:hover {
    background: var(--tuh-modal-text-muted);
}

/* ===========================================
   TEMPLATE: CENTERED
   =========================================== */
.tuh-modal-centered .tuh-modal-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--tuh-modal-primary), #8b5cf6);
    border-radius: 16px;
    margin: 0 auto 16px;
}

.tuh-modal-centered .tuh-modal-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.tuh-modal-tabs-pill {
    display: flex;
    gap: 8px;
    margin: 24px 32px 0;
    padding: 4px;
    background: var(--tuh-modal-input-bg);
    border-radius: 12px;
}

.tuh-modal-tabs-pill .tuh-modal-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tuh-modal-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.tuh-modal-tabs-pill .tuh-modal-tab:hover {
    color: var(--tuh-modal-text);
}

.tuh-modal-tabs-pill .tuh-modal-tab.active {
    background: var(--tuh-modal-bg);
    color: var(--tuh-modal-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tuh-modal-social-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.tuh-modal-social-row .tuh-modal-social-btn {
    flex: 1;
    padding: 10px;
}

.tuh-modal-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===========================================
   TEMPLATE: MINIMAL
   =========================================== */
.tuh-modal-minimal .tuh-modal-header-minimal {
    padding: 24px 32px 0;
    text-align: center;
}

.tuh-modal-brand-minimal {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--tuh-modal-text);
    letter-spacing: -0.02em;
}

.tuh-modal-tabs-underline {
    display: flex;
    margin: 20px 32px 0;
    border-bottom: 1px solid var(--tuh-modal-border);
}

.tuh-modal-tabs-underline .tuh-modal-tab {
    flex: 1;
    padding: 12px 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--tuh-modal-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.tuh-modal-tabs-underline .tuh-modal-tab.active {
    color: var(--tuh-modal-text);
    border-bottom-color: var(--tuh-modal-text);
}

.tuh-modal-social-minimal {
    margin-bottom: 16px;
}

.tuh-modal-social-minimal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: transparent;
    border: 1px solid var(--tuh-modal-border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--tuh-modal-text);
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
    cursor: pointer;
}

.tuh-modal-social-minimal-btn:hover {
    background: var(--tuh-modal-input-bg);
}

.tuh-modal-social-minimal-btn svg {
    width: 18px;
    height: 18px;
}

.tuh-modal-divider-minimal {
    margin: 16px 0;
}

.tuh-modal-form-minimal {
    gap: 14px;
}

.tuh-modal-field-minimal input {
    background: transparent;
    border: 1px solid var(--tuh-modal-border);
    padding: 11px 14px;
}

.tuh-modal-field-minimal input:focus {
    border-color: var(--tuh-modal-text);
    box-shadow: none;
}

.tuh-modal-options-minimal {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tuh-modal-submit-minimal {
    background: var(--tuh-modal-text);
    color: var(--tuh-modal-bg);
    border-radius: 8px;
    padding: 12px;
}

.tuh-modal-submit-minimal:hover:not(:disabled) {
    opacity: 0.9;
    transform: none;
}

/* ===========================================
   TEMPLATE: INTEGRATED
   =========================================== */
.tuh-modal-integrated .tuh-modal-header-gradient {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    padding: 32px;
    text-align: center;
    border-radius: var(--tuh-modal-radius) var(--tuh-modal-radius) 0 0;
    margin: -1px -1px 0;
}

.tuh-modal-icon-circle {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin: 0 auto 12px;
}

.tuh-modal-icon-circle svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

.tuh-modal-title-integrated {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.tuh-modal-tabs-boxed {
    display: flex;
    margin: 0 24px;
    transform: translateY(-50%);
    background: var(--tuh-modal-bg);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tuh-modal-tabs-boxed .tuh-modal-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tuh-modal-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.tuh-modal-tabs-boxed .tuh-modal-tab.active {
    background: var(--tuh-modal-primary);
    color: #fff;
}

.tuh-modal-social-stacked {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.tuh-modal-social-btn-full {
    width: 100%;
}

.tuh-modal-input-rounded,
.tuh-modal-integrated .tuh-modal-field input {
    border-radius: 10px;
}

.tuh-modal-submit-gradient {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 10px;
}

.tuh-modal-submit-gradient:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

/* Fix padding for integrated when has gradient header */
.tuh-modal-integrated .tuh-modal-panel {
    padding-top: 0;
}

.tuh-modal-integrated .tuh-modal-tabs-boxed + .tuh-modal-panel.active {
    padding-top: 12px;
}

/* Close button on gradient header - needs white color for contrast
   Note: .tuh-modal-close is SIBLING of .tuh-modal-integrated, not child
   So we use :has() to target the container that contains integrated */
.tuh-modal-container:has(.tuh-modal-integrated) .tuh-modal-close {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.tuh-modal-container:has(.tuh-modal-integrated) .tuh-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ===========================================
   RESPONSIVE - MOBILE FIXES
   =========================================== */

/* Tablet (768px) */
@media (max-width: 768px) {
    .tuh-modal-container {
        max-width: 400px;
    }
}

/* Small devices (480px) - já existia parcialmente, complementando */
@media (max-width: 480px) {
    .tuh-modal-social-row {
        flex-direction: column;
        gap: 10px;
    }

    .tuh-modal-social-row .tuh-modal-social-btn {
        width: 100%;
    }

    .tuh-modal-options {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .tuh-modal-tabs-pill {
        gap: 4px;
        padding: 3px;
    }

    .tuh-modal-tabs-pill .tuh-modal-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Extra small devices (375px) */
@media (max-width: 375px) {
    .tuh-modal-header {
        padding: 24px 20px 0;
    }

    .tuh-modal-panel {
        padding: 20px 16px 24px;
    }

    .tuh-modal-tabs {
        margin: 20px 16px 0;
    }

    .tuh-modal-tabs-pill {
        margin: 20px 16px 0;
    }

    .tuh-modal-tabs-boxed {
        margin: 0 16px;
    }

    .tuh-modal-title {
        font-size: 1.2rem;
    }

    .tuh-modal-submit {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* Very small devices (320px) */
@media (max-width: 320px) {
    .tuh-modal {
        padding: 10px;
    }

    .tuh-modal-header {
        padding: 20px 16px 0;
    }

    .tuh-modal-panel {
        padding: 16px 12px 20px;
    }

    .tuh-modal-tabs,
    .tuh-modal-tabs-pill,
    .tuh-modal-tabs-boxed {
        margin-left: 12px;
        margin-right: 12px;
    }

    .tuh-modal-field input {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .tuh-modal-icon-circle {
        width: 52px;
        height: 52px;
    }

    .tuh-modal-icon-circle svg {
        width: 26px;
        height: 26px;
    }

    .tuh-modal-title-integrated {
        font-size: 1.1rem;
    }
}

/* ===========================================
   REDUCED MOTION (Accessibility)
   =========================================== */
@media (prefers-reduced-motion: reduce) {
    .tuh-modal,
    .tuh-modal *,
    .tuh-modal *::before,
    .tuh-modal *::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
}

/* ===========================================
   SAFE AREA INSETS (Notched devices)
   =========================================== */
@supports (padding: env(safe-area-inset-top)) {
    .tuh-modal {
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    @media (max-width: 480px) {
        .tuh-modal-container {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}
