/* Mobile-First CSS for Authentication Pages */

/* Mobile authentication variables */
:root {
    --mobile-auth-card-width: 95%;
    --mobile-auth-card-padding: 1.5rem;
    --mobile-form-spacing: 1rem;
    --mobile-button-height: 48px;
    --mobile-input-height: 48px;
    --mobile-border-radius: 16px;
}

/* Mobile authentication container */
@media (max-width: 768px) {
    .auth-container {
        min-height: calc(100vh - var(--mobile-header-height));
        padding: 1rem 0;
        align-items: flex-start;
        padding-top: calc(var(--mobile-header-height) + 1rem);
    }
    
    .auth-card {
        width: var(--mobile-auth-card-width);
        max-width: 100%;
        padding: var(--mobile-auth-card-padding);
        border-radius: var(--mobile-border-radius);
        margin: 0 auto;
    }
    
    /* Mobile auth header */
    .auth-header {
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    .auth-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    .auth-subtitle {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    /* Mobile form optimizations */
    .auth-form {
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: var(--mobile-form-spacing);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--mobile-form-spacing);
    }
    
    /* Mobile form labels */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: #f0f0f0;
    }
    
    /* Mobile form inputs */
    .form-input {
        height: var(--mobile-input-height);
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: var(--mobile-border-radius);
        border: 2px solid #333;
        background: #2a2a2a;
        color: #f0f0f0;
        width: 100%;
        transition: all 0.3s ease;
    }
    
    .form-input:focus {
        border-color: #A220E8;
        box-shadow: 0 0 0 3px rgba(162, 32, 232, 0.1);
        outline: none;
    }
    
    .form-input::placeholder {
        color: #666;
        font-size: 16px;
    }
    
    /* Mobile form options */
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Mobile checkbox styling */
    .checkbox-container {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        color: #ccc;
        font-size: 0.9rem;
        cursor: pointer;
        line-height: 1.4;
    }
    
    .checkmark {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        background: #2a2a2a;
        border: 2px solid #333;
        border-radius: 6px;
        display: inline-block;
        position: relative;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }
    
    .checkbox-container input[type="checkbox"]:checked + .checkmark {
        background: #A220E8;
        border-color: #A220E8;
    }
    
    .checkbox-container input[type="checkbox"]:checked + .checkmark::after {
        content: '✓';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: white;
        font-size: 14px;
        font-weight: bold;
    }
    
    /* Mobile links */
    .forgot-password {
        color: #A220E8;
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 500;
        padding: 0.5rem 0;
        display: inline-block;
    }
    
    .terms-link {
        color: #A220E8;
        text-decoration: none;
        font-weight: 500;
    }
    
    /* Mobile auth button */
    .auth-btn {
        width: 100%;
        height: var(--mobile-button-height);
        background: linear-gradient(135deg, #A220E8 0%, #8B1FD9 100%);
        color: white;
        border: none;
        border-radius: var(--mobile-border-radius);
        font-weight: 600;
        font-size: 1rem;
        cursor: pointer;
        transition: all 0.3s ease;
        font-family: inherit;
        letter-spacing: 0.5px;
        margin-bottom: 1.5rem;
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .auth-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(162, 32, 232, 0.4);
    }
    
    .auth-btn:active {
        transform: translateY(0);
        box-shadow: 0 4px 15px rgba(162, 32, 232, 0.3);
    }
    
    /* Mobile auth footer */
    .auth-footer {
        text-align: center;
        color: #ccc;
        font-size: 0.9rem;
        padding-top: 1rem;
        border-top: 1px solid #333;
    }
    
    .auth-link {
        color: #A220E8;
        text-decoration: none;
        font-weight: 600;
        padding: 0.5rem 0;
        display: inline-block;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .auth-container {
        padding: 0.5rem 0;
        padding-top: calc(var(--mobile-header-height) + 0.5rem);
    }
    
    .auth-card {
        width: 98%;
        padding: 1rem;
        margin: 0 0.5rem;
    }
    
    .auth-title {
        font-size: 1.75rem;
    }
    
    .auth-subtitle {
        font-size: 0.9rem;
    }
    
    .form-input {
        height: 44px;
        padding: 0.75rem;
        font-size: 16px;
    }
    
    .auth-btn {
        height: 44px;
        font-size: 0.95rem;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-options {
        margin-bottom: 1rem;
    }
}

/* Mobile touch optimizations */
@media (max-width: 768px) {
    /* Touch-friendly form elements */
    .form-input,
    .auth-btn,
    .checkbox-container {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Improved touch feedback */
    .auth-btn:active {
        background: linear-gradient(135deg, #8B1FD9 0%, #7A1EC8 100%);
    }
    
    .form-input:focus {
        transform: scale(1.02);
    }
    
    /* Better mobile scrolling */
    .auth-container {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile-specific animations */
    .auth-card {
        animation: slideUpMobile 0.4s ease-out;
    }
    
    @keyframes slideUpMobile {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Mobile landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .auth-container {
        min-height: 100vh;
        padding-top: calc(var(--mobile-header-height) + 0.5rem);
    }
    
    .auth-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .auth-title {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .auth-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
}

/* Mobile performance optimizations */
@media (max-width: 768px) {
    /* Reduce animations for better performance */
    .auth-card,
    .form-input,
    .auth-btn {
        transition: all 0.2s ease;
    }
    
    /* Optimize shadows for mobile */
    .auth-card {
        box-shadow: 0 4px 20px rgba(162, 32, 232, 0.15);
    }
    
    /* Mobile-specific loading states */
    .auth-btn.loading {
        background: #666;
        cursor: not-allowed;
        position: relative;
    }
    
    .auth-btn.loading::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 20px;
        top: 50%;
        left: 50%;
        margin-left: -10px;
        margin-top: -10px;
        border: 2px solid transparent;
        border-top: 2px solid white;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
}

/* Mobile accessibility improvements */
@media (max-width: 768px) {
    /* Better focus indicators for mobile */
    .form-input:focus,
    .auth-btn:focus,
    .checkbox-container:focus-within .checkmark {
        outline: 2px solid #A220E8;
        outline-offset: 2px;
    }
    
    /* Improved contrast for mobile */
    .form-label {
        color: #f5f5f5;
    }
    
    .auth-subtitle {
        color: #ddd;
    }
    
    /* Better touch targets */
    .checkbox-container,
    .auth-btn {
        touch-action: manipulation;
    }
    
    /* Mobile form validation improvements */
    .form-input.error {
        border-color: #e74c3c;
        box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
    }
    
    .error-message {
        color: #e74c3c;
        font-size: 0.8rem;
        margin-top: 0.25rem;
        display: block;
        line-height: 1.3;
    }
    
    .form-input.success {
        border-color: #27ae60;
        box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
    }
}

/* Mobile keyboard optimizations */
@media (max-width: 768px) {
    /* Prevent zoom on input focus (iOS) */
    .form-input {
        font-size: 16px !important;
    }
    
    /* Better mobile form spacing */
    .auth-form {
        margin-bottom: 0;
    }
    
    /* Mobile-specific button states */
    .auth-btn:disabled {
        background: #666;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }
} 