/* 
 * Support Authorization System Styles
 * Automated Living - Phase 2
 * Custom styles for support authorization form
 * All classes prefixed with .support- to avoid conflicts
 */

/* CSS Variables (inheriting from main site) */
:root {
    --support-primary: var(--primary-color, #100f0d);
    --support-secondary: var(--secondary-color, #4a4a4a);
    --support-accent: var(--accent-color, #5e60ce);
    --support-light: var(--light-color, #f8f9fa);
    --support-dark: var(--dark-color, #212529);
    --support-gray: var(--gray-color, #6c757d);
    --support-light-gray: var(--light-gray, #e9ecef);
    --support-success: #28a745;
    --support-error: #dc3545;
    --support-warning: #ffc107;
    --support-info: #17a2b8;
    --support-transition: 0.3s ease;
    --support-border-radius: 6px;
    --support-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --support-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    --support-modal-z-index: 10000;
    --support-input-height: 40px;
    --support-button-height: 44px;
    --support-form-spacing: 1rem;
    --support-compact-spacing: 0.375rem;
}

/* Support Authorization Section */
.support-authorization {
    padding-top: 120px;
    min-height: calc(100vh - 200px);
    background: linear-gradient(135deg, var(--support-light) 0%, rgba(94, 96, 206, 0.05) 100%);
}

.support-auth-header {
    text-align: center;
    margin-bottom: 3rem;
}

.support-auth-header h1 {
    font-size: 2.5rem;
    color: var(--support-primary);
    margin-bottom: 1rem;
}

.support-intro {
    font-size: 1.1rem;
    color: var(--support-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Terms Information Display */
.support-terms-info {
    background-color: white;
    border-radius: var(--support-border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--support-shadow);
    transition: box-shadow var(--support-transition);
}

.support-terms-info:hover {
    box-shadow: var(--support-shadow-hover);
}

.support-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.support-info-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(94, 96, 206, 0.05), rgba(94, 96, 206, 0.1));
    border-radius: var(--support-border-radius);
    transition: transform var(--support-transition);
}

.support-info-card:hover {
    transform: translateY(-2px);
}

.support-info-icon {
    width: 50px;
    height: 50px;
    background-color: var(--support-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.support-info-content {
    display: flex;
    flex-direction: column;
}

.support-info-label {
    font-size: 0.875rem;
    color: var(--support-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.support-info-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--support-primary);
}

/* Form Styles */
.support-form {
    background-color: white;
    border-radius: var(--support-border-radius);
    padding: 1.75rem;
    box-shadow: var(--support-shadow);
    margin-bottom: 2rem;
}

.support-form-group {
    margin-bottom: var(--support-form-spacing);
    /* Clear floats to prevent layout issues */
    clear: both;
    /* Ensure consistent layout */
    overflow: hidden;
}

.support-label {
    display: block;
    font-weight: 600;
    color: var(--support-primary);
    margin-bottom: var(--support-compact-spacing);
    font-size: 0.9375rem;
}

.support-required {
    color: var(--support-error);
    font-weight: 700;
}

.support-optional {
    color: var(--support-gray);
    font-weight: 400;
    font-size: 0.875rem;
}

.support-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-family: var(--body-font);
    border: 1.5px solid var(--support-light-gray);
    border-radius: var(--support-border-radius);
    background-color: white;
    color: var(--support-primary);
    transition: all var(--support-transition);
    min-height: var(--support-input-height);
}

/* Modern form input widths - match expected content length */
.support-input[type="email"] {
    max-width: 320px;
}

.support-input[type="tel"] {
    max-width: 200px;
}

.support-input[name="full_name"] {
    max-width: 280px;
}

.support-input[name="company"] {
    max-width: 350px;
}

.support-signature-input {
    max-width: 400px;
    /* Ensure input doesn't float with help text */
    display: block;
}

.support-input:focus {
    outline: none;
    border-color: var(--support-accent);
    box-shadow: 0 0 0 3px rgba(94, 96, 206, 0.1);
}

.support-input:hover:not(:focus) {
    border-color: var(--support-gray);
}

.support-input.support-error-input {
    border-color: var(--support-error);
}

.support-input.support-success-input {
    border-color: var(--support-success);
}

.support-signature-input {
    font-family: 'Brush Script MT', cursive, var(--body-font);
    font-size: 1.125rem;
    font-style: italic;
    padding: 0.625rem 0.875rem;
    min-height: var(--support-button-height);
    max-width: 400px;
}

/* Two-column layout for name fields on desktop */
.name-fields-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: var(--support-form-spacing);
}

.name-fields-group .support-form-group {
    margin-bottom: 0;
}

.support-field-help {
    font-size: 0.8125rem;
    color: var(--support-gray);
    margin-bottom: var(--support-compact-spacing);
}

.support-help-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--support-info);
    margin-top: 0.5rem;
    /* Ensure it always stays below the input */
    clear: both;
    width: 100%;
}

.support-error {
    display: block;
    color: var(--support-error);
    font-size: 0.8125rem;
    margin-top: var(--support-compact-spacing);
    min-height: 1.2rem;
    font-weight: 500;
    /* Prevent layout shift when error appears/disappears */
    transition: opacity 0.2s ease;
}

/* Checkbox Styles */
.support-checkbox-group {
    margin-bottom: var(--support-form-spacing);
    position: relative;
}

.support-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
}

.support-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-right: 0.75rem;
    margin-top: 0.125rem;
    cursor: pointer;
    accent-color: var(--support-accent);
}

.support-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.support-checkbox:focus {
    outline: 2px solid var(--support-accent);
    outline-offset: 2px;
}

.support-checkbox-text {
    font-size: 1rem;
    color: var(--support-primary);
    line-height: 1.5;
}

.support-link {
    color: var(--support-accent);
    text-decoration: underline;
    font-weight: 600;
    transition: all var(--support-transition);
    position: relative;
    display: inline-block;
}

.support-link:hover {
    color: var(--support-primary);
    transform: translateY(-1px);
}

/* Clever ToS Link Animation - subtle pulse to draw attention */
.support-checkbox-group:first-of-type .support-link {
    animation: tos-link-glow 3s infinite;
}

@keyframes tos-link-glow {
    0%, 100% {
        text-shadow: 0 0 0 transparent;
    }
    50% {
        text-shadow: 0 0 8px rgba(94, 96, 206, 0.5);
    }
}

/* Stop animation once checkbox is enabled */
.support-checkbox:not(:disabled) ~ .support-checkbox-text .support-link {
    animation: none;
}

/* Tooltip for disabled checkbox */
.support-tos-tooltip {
    position: absolute;
    background: var(--support-primary);
    color: white;
    padding: 0.625rem 0.875rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    left: 30px;
    top: -45px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Tooltip arrow */
.support-tos-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--support-primary);
}

/* Show tooltip on hover or focus when checkbox is disabled */
.support-checkbox-group:hover .support-tos-tooltip.show,
.support-checkbox:focus ~ .support-tos-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Pulse animation for Terms link when tooltip is shown */
.support-tos-tooltip.show ~ .support-checkbox-label .support-link {
    animation: tos-link-pulse 1s ease-in-out;
}

@keyframes tos-link-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        color: var(--support-primary);
    }
}

/* Visual hint arrow pointing to ToS link */
.support-tos-hint-arrow {
    position: absolute;
    left: 200px;
    top: 2px;
    font-size: 1.2rem;
    color: var(--support-accent);
    animation: arrow-bounce 1.5s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.support-tos-hint-arrow.visible {
    opacity: 1;
}

@keyframes arrow-bounce {
    0%, 100% {
        transform: translateX(0) rotate(-45deg);
    }
    50% {
        transform: translateX(-5px) rotate(-45deg);
    }
}

/* Accessibility: ensure tooltip is readable in high contrast mode */
body.high-contrast .support-tos-tooltip {
    background: black;
    color: white;
    border: 2px solid white;
}

/* Dark mode tooltip */
body.dark-mode .support-tos-tooltip {
    background: #fff;
    color: var(--support-primary);
}

body.dark-mode .support-tos-tooltip::after {
    border-top-color: #fff;
}

/* Turnstile Widget */
.support-turnstile {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-start;
}

/* Form Actions */
.support-form-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.support-submit-btn {
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--heading-font);
    color: white;
    background: linear-gradient(135deg, var(--support-accent), #7678ed);
    border: none;
    border-radius: var(--support-border-radius);
    cursor: pointer;
    transition: all var(--support-transition);
    box-shadow: 0 4px 15px rgba(94, 96, 206, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--support-button-height);
}

.support-submit-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(94, 96, 206, 0.4);
}

.support-submit-btn:not(:disabled):active {
    transform: translateY(0);
}

.support-submit-btn:disabled {
    background: linear-gradient(135deg, var(--support-gray), #8c8c8c);
    cursor: not-allowed;
    opacity: 0.6;
}

.support-submit-btn.support-loading .support-btn-text {
    opacity: 0;
}

.support-submit-btn.support-loading .support-btn-spinner {
    display: inline-block;
}

.support-btn-spinner {
    display: none;
    position: absolute;
}

.support-submit-status {
    font-size: 0.875rem;
    color: var(--support-gray);
    text-align: center;
    min-height: 1.25rem;
}

/* Messages */
.support-message-container {
    margin-bottom: var(--support-form-spacing);
    min-height: 0;
    transition: min-height 0.3s ease;
}

.support-message-container.has-message {
    min-height: 60px;
}

.support-message {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: message-slide-down 0.3s ease;
}

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

.support-message.support-success {
    display: block;
    background: linear-gradient(135deg,
        rgba(40, 167, 69, 0.1),
        rgba(40, 167, 69, 0.05));
    border: 2px solid var(--support-success);
    border-left-width: 4px;
    color: var(--support-success);
}

.support-message.support-error {
    display: block;
    background: linear-gradient(135deg,
        rgba(220, 53, 69, 0.1),
        rgba(220, 53, 69, 0.05));
    border: 2px solid var(--support-error);
    border-left-width: 4px;
    color: var(--support-error);
}

.support-message i {
    margin-right: 0.5rem;
    font-size: 1.125rem;
}

/* Sticky positioning for visibility */
@media (min-width: 768px) {
    .support-message-container.sticky {
        position: sticky;
        top: 80px;
        z-index: 100;
        background: white;
        padding: 0.5rem 0;
        margin: -0.5rem -1.75rem var(--support-form-spacing);
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }
}

/* Security Notice */
.support-security-notice {
    background-color: rgba(94, 96, 206, 0.05);
    border-left: 4px solid var(--support-accent);
    border-radius: var(--support-border-radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.support-security-notice i {
    font-size: 1.5rem;
    color: var(--support-accent);
    flex-shrink: 0;
}

.support-security-notice p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--support-secondary);
}

/* Animations */
@keyframes support-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes support-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.support-form-group.support-animate-error {
    animation: support-shake 0.3s ease;
}

/* Dark Mode Styles */
body.dark-mode .support-authorization {
    background: linear-gradient(135deg, var(--light-color) 0%, rgba(187, 134, 252, 0.1) 100%);
}

body.dark-mode .support-auth-header h1 {
    color: var(--dark-color);
}

body.dark-mode .support-intro {
    color: var(--gray-color);
}

body.dark-mode .support-terms-info {
    background-color: #1e1e1e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .support-info-card {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.1), rgba(187, 134, 252, 0.15));
}

body.dark-mode .support-info-value {
    color: var(--dark-color);
}

body.dark-mode .support-form {
    background-color: #1e1e1e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .support-label {
    color: var(--dark-color);
}

body.dark-mode .support-input {
    background-color: #2a2a2a;
    border-color: #444;
    color: var(--dark-color);
}

body.dark-mode .support-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.2);
}

body.dark-mode .support-input:hover:not(:focus) {
    border-color: #666;
}

body.dark-mode .support-checkbox-text {
    color: var(--dark-color);
}

body.dark-mode .support-link {
    color: var(--accent-color);
}

body.dark-mode .support-link:hover {
    color: var(--dark-color);
}

body.dark-mode .support-submit-btn {
    background: linear-gradient(135deg, var(--accent-color), #9d4edd);
    box-shadow: 0 4px 15px rgba(187, 134, 252, 0.3);
}

body.dark-mode .support-submit-btn:not(:disabled):hover {
    box-shadow: 0 6px 20px rgba(187, 134, 252, 0.4);
}

body.dark-mode .support-security-notice {
    background-color: rgba(187, 134, 252, 0.1);
}

body.dark-mode .support-security-notice p {
    color: var(--gray-color);
}

body.dark-mode .support-message.support-success {
    background-color: rgba(40, 167, 69, 0.2);
}

body.dark-mode .support-message.support-error {
    background-color: rgba(220, 53, 69, 0.2);
}

/* High Contrast Mode */
body.high-contrast .support-authorization {
    background: white;
}

body.high-contrast .support-terms-info,
body.high-contrast .support-form {
    background-color: white;
    border: 2px solid black;
    box-shadow: none;
}

body.high-contrast .support-info-card {
    background: white;
    border: 2px solid black;
}

body.high-contrast .support-info-icon {
    background-color: black;
    color: white;
}

body.high-contrast .support-input {
    background-color: white;
    border: 2px solid black;
    color: black;
}

body.high-contrast .support-input:focus {
    border-color: #0000ff;
    box-shadow: 0 0 0 3px rgba(0, 0, 255, 0.3);
}

body.high-contrast .support-link {
    color: #0000ff;
    text-decoration: underline;
    font-weight: bold;
}

body.high-contrast .support-link:hover {
    color: #ff0000;
}

body.high-contrast .support-submit-btn {
    background: black;
    color: white;
    border: 2px solid black;
    box-shadow: none;
}

body.high-contrast .support-submit-btn:not(:disabled):hover {
    background: white;
    color: black;
    border: 2px solid black;
    transform: none;
}

body.high-contrast .support-security-notice {
    background-color: white;
    border: 2px solid black;
}

/* Reduce Motion */
body.reduce-motion * {
    animation: none !important;
    transition: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .support-authorization {
        padding-top: 90px;
    }

    .support-auth-header h1 {
        font-size: 2rem;
    }

    .support-intro {
        font-size: 1rem;
    }

    .support-form {
        padding: 1.25rem;
    }

    .support-terms-info {
        padding: 1.5rem;
    }

    .support-info-grid {
        grid-template-columns: 1fr;
    }

    .support-submit-btn {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }

    .support-turnstile {
        justify-content: center;
    }
    
    /* Stack name fields on mobile */
    .name-fields-group {
        grid-template-columns: 1fr;
    }
    
    /* Full width inputs on mobile */
    .support-input[type="email"],
    .support-input[type="tel"],
    .support-input[name="full_name"],
    .support-input[name="company"],
    .support-signature-input {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .support-auth-header h1 {
        font-size: 1.75rem;
    }

    .support-form {
        padding: 1rem;
    }
    
    .support-message-container.sticky {
        margin: -0.5rem -1rem var(--support-form-spacing);
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .support-terms-info {
        padding: 1rem;
    }

    .support-info-card {
        flex-direction: column;
        text-align: center;
    }

    .support-submit-btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }
    
    /* Ensure all inputs are easily tappable on small screens */
    .support-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.625rem 0.875rem;
    }
}

/* Print Styles */
@media print {
    .support-authorization {
        padding-top: 0;
        background: white;
    }

    .support-form-actions,
    .support-turnstile,
    .support-security-notice {
        display: none;
    }

    .support-terms-info,
    .support-form {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Accessibility Enhancements */
.support-input:focus-visible,
.support-checkbox:focus-visible,
.support-submit-btn:focus-visible {
    outline: 3px solid var(--support-accent);
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Modal Styles */
.tos-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--support-modal-z-index);
}

.tos-modal.tos-modal-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tos-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.tos-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    height: 80vh;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: tos-modal-enter 0.3s ease;
}

@keyframes tos-modal-enter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tos-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--support-light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tos-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--support-primary);
}

.tos-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--support-gray);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
    min-width: 44px;
    min-height: 44px;
}

.tos-modal-close:hover {
    color: var(--support-primary);
}

.tos-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    line-height: 1.6;
/* Styled markdown content in modal */
.tos-content h1 {
    font-size: 1.75rem;
    color: var(--support-primary);
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--support-light-gray);
}

.tos-content h1:first-child {
    margin-top: 0;
}

.tos-content h2 {
    font-size: 1.35rem;
    color: var(--support-primary);
    margin: 1.25rem 0 0.75rem;
    font-weight: 600;
}

.tos-content h3 {
    font-size: 1.1rem;
    color: var(--support-secondary);
    margin: 1rem 0 0.5rem;
    font-weight: 600;
}

.tos-content p {
    margin: 0.75rem 0;
    color: var(--support-primary);
}

.tos-content ul,
.tos-content ol {
    margin: 0.75rem 0;
    padding-left: 2rem;
}

.tos-content li {
    margin: 0.5rem 0;
    color: var(--support-primary);
    line-height: 1.6;
}

.tos-content strong {
    font-weight: 600;
    color: var(--support-primary);
}

.tos-content em {
    font-style: italic;
}

    font-size: 0.95rem;
}

.tos-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    color: var(--support-gray);
}

.tos-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--support-light-gray);
    background: var(--support-light);
}

.tos-scroll-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--support-warning);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    animation: tos-bounce 2s infinite;
}

.tos-scroll-indicator.hidden {
    display: none;
}

@keyframes tos-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.tos-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.tos-cancel-btn,
.tos-accept-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.tos-cancel-btn {
    background: white;
    border: 1.5px solid var(--support-gray);
    color: var(--support-gray);
}

.tos-cancel-btn:hover {
    background: var(--support-light);
}

.tos-accept-btn {
    background: var(--support-accent);
    border: none;
    color: white;
    min-width: 140px;
}

.tos-accept-btn:disabled {
    background: var(--support-gray);
    cursor: not-allowed;
    opacity: 0.6;
}

.tos-accept-btn:not(:disabled):hover {
    background: var(--support-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(94, 96, 206, 0.3);
}

.tos-accept-check {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Mobile responsiveness for modal */
@media (max-width: 768px) {
    .tos-modal-content {
        width: 95%;
        height: 90vh;
        max-height: 95vh;
        border-radius: 8px;
        margin: 1rem;
    }
    
    .tos-modal-header {
        padding: 1rem;
    }
    
    .tos-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .tos-modal-body {
        padding: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .tos-modal-footer {
        padding: 1rem;
    }
    
    .tos-modal-actions {
        flex-direction: column;
    }
    
    .tos-cancel-btn,
    .tos-accept-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .tos-modal-content {
        width: calc(100% - 2rem);
        margin: 1rem;
    }
}

/* Dark mode support for modal */
body.dark-mode .tos-modal-content {
    background: #1e1e1e;
}

body.dark-mode .tos-modal-header,
body.dark-mode .tos-modal-footer {
    border-color: #444;
}

body.dark-mode .tos-modal-header h2 {
    color: var(--dark-color);
}

body.dark-mode .tos-modal-body {
    color: #aaa;
}

body.dark-mode .tos-cancel-btn {
    background: #333;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .tos-cancel-btn:hover {
    background: #3a3a3a;
}

/* Dark mode for markdown content in modal */
body.dark-mode .tos-content h1,
body.dark-mode .tos-content h2,
body.dark-mode .tos-content h3 {
    color: #e0e0e0;
}

body.dark-mode .tos-content p,
body.dark-mode .tos-content li {
    color: #aaa;
}

body.dark-mode .tos-content strong {
    color: #e0e0e0;
}

/* Dark mode buttons */
body.dark-mode .tos-accept-btn:disabled {
    background-color: #2a2a2a;
    color: #666;
}

body.dark-mode .tos-accept-btn:not(:disabled) {
    background-color: var(--accent-color);
}

body.dark-mode .tos-scroll-indicator {
    background-color: rgba(255, 255, 255, 0.05);
    color: #aaa;
}

/* Dark mode modal close button */
body.dark-mode .tos-modal-close {
    color: #e0e0e0;
}

body.dark-mode .tos-modal-close:hover {
    color: #fff;
}

/* Dark mode modal footer */
body.dark-mode .tos-modal-footer {
    background: #2a2a2a;
}