/**
 * Free Trial Registration Form Styles
 * 
 * This external CSS file provides supplementary styles for the free trial registration form.
 * Most styles are defined inline in the view files (index.php, form.php, faq.php, success.php).
 * 
 * This file contains:
 * - CSS custom properties (variables) for dark mode color scheme
 * - Stage transition animations
 * - Additional utility classes
 * - Print styles
 * - Loading/spinner animations
 * 
 * Requirements: 1.1, 1.2, 1.3, 1.4, 1.5
 */

/* ============================================ */
/* CSS Custom Properties - Dark Mode Color Scheme */
/* Defined here as a reference and fallback */
/* ============================================ */
:root {
    /* Background Colors */
    --primary-bg: #1a1a1a;
    --secondary-bg: #2d2d2d;
    --accent-bg: #3d3d3d;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    
    /* Accent Colors */
    --accent-red: #dc3545;
    --accent-red-hover: #c82333;
    
    /* Border Colors */
    --border-color: #444444;
    
    /* Status Colors */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    
    /* Transition Timing */
    --transition-fast: 0.15s;
    --transition-normal: 0.2s;
    --transition-slow: 0.3s;
}

/* ============================================ */
/* Stage Transition Animations */
/* ============================================ */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade Out Animation */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Slide In from Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In from Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In from Bottom */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Out to Left */
@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Stage Transition Classes */
.stage-enter {
    animation: slideInRight var(--transition-slow) ease-out forwards;
}

.stage-enter-reverse {
    animation: slideInLeft var(--transition-slow) ease-out forwards;
}

.stage-exit {
    animation: slideOutLeft var(--transition-slow) ease-out forwards;
}

.stage-fade-in {
    animation: fadeIn var(--transition-normal) ease-out forwards;
}

.stage-fade-out {
    animation: fadeOut var(--transition-normal) ease-out forwards;
}

/* Section Reveal Animation */
.section-reveal {
    animation: slideInUp var(--transition-slow) ease-out forwards;
}

/* ============================================ */
/* Loading/Spinner Animations */
/* ============================================ */

/* Spinner Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.large {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================ */
/* Utility Classes */
/* ============================================ */

/* Visibility */
.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

.visible {
    display: block !important;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-error {
    color: var(--error-color);
}

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Flex Utilities */
.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ============================================ */
/* Focus States for Accessibility */
/* ============================================ */

/* Custom focus outline for keyboard navigation */
.free-trial-page *:focus-visible {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

/* Remove default focus outline when using mouse */
.free-trial-page *:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================ */
/* Shake Animation for Validation Errors */
/* ============================================ */

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ============================================ */
/* Print Styles */
/* ============================================ */

@media print {
    /* Reset background colors for printing */
    body.free-trial-page {
        background-color: white !important;
        color: black !important;
    }
    
    .free-trial-container {
        max-width: 100%;
        padding: 0;
    }
    
    /* Hide non-essential elements */
    .free-trial-header,
    .free-trial-footer,
    .faq-column,
    .stage-navigation,
    .btn-next,
    .btn-prev,
    .btn-submit,
    .btn-add-member,
    .btn-remove-member,
    #success-container {
        display: none !important;
    }
    
    /* Make form column full width */
    .free-trial-layout {
        display: block;
    }
    
    .form-column {
        max-width: 100%;
        flex: none;
    }
    
    /* Adjust form container for print */
    .registration-form-container {
        background-color: white !important;
        border: 1px solid #ccc;
        padding: 20px;
    }
    
    /* Adjust form elements for print */
    .form-stage,
    .form-section {
        background-color: white !important;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        background-color: white !important;
        border: 1px solid #999;
        color: black !important;
    }
    
    /* Show all stages for print */
    .form-stage,
    .form-section {
        display: block !important;
    }
    
    /* Adjust text colors for print */
    .form-title,
    .stage-title,
    .section-title,
    .form-label,
    .checkbox-text {
        color: black !important;
    }
    
    .form-intro,
    .stage-description {
        color: #333 !important;
    }
    
    /* Hide guardian message in print */
    .guardian-message {
        display: none !important;
    }
    
    /* Adjust stage number for print */
    .stage-number {
        background-color: #333 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Page break controls */
    .form-section {
        page-break-before: auto;
    }
    
    .family-member-entry {
        page-break-inside: avoid;
    }
}

/* ============================================ */
/* High Contrast Mode Support */
/* ============================================ */

@media (prefers-contrast: high) {
    :root {
        --border-color: #666666;
        --text-secondary: #e0e0e0;
        --text-muted: #b0b0b0;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        border-width: 2px;
    }
    
    .checkbox-custom {
        border-width: 3px;
    }
}

/* ============================================ */
/* Reduced Motion Support */
/* ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .stage-enter,
    .stage-enter-reverse,
    .stage-exit,
    .stage-fade-in,
    .stage-fade-out,
    .section-reveal {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .loading-spinner {
        animation: none;
        border-color: var(--accent-red);
    }
    
    .success-icon {
        animation: none;
    }
}
