/* ================================================================
   MOBILE AUTHENTICATION PROFESSIONAL DESIGN v2.0
   Modern, Secure, Touch-Optimized Login/Register Flows
   ================================================================ */

@media (max-width: 768px) {
    /* ================================================================
       RESET FOR MOBILE FORMS
       ================================================================ */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    body {
        background: linear-gradient(135deg, #0a0e27 0%, #1a1e3f 100%);
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        margin: 0;
        padding: 0;
    }

    /* ================================================================
       PROFESSIONAL LOGIN/REGISTER CONTAINER
       ================================================================ */
    .auth-container,
    .login-container,
    .register-container,
    .forgot-password-container {
        width: 100%;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 20px;
        padding-top: max(40px, env(safe-area-inset-top));
        padding-bottom: max(40px, env(safe-area-inset-bottom));
        box-sizing: border-box;
        background: linear-gradient(180deg, #0a0e27 0%, #16192f 50%, #1a1e3f 100%);
    }

    /* ================================================================
       LOGO & BRANDING
       ================================================================ */
    .auth-logo,
    .logo {
        width: 80px;
        height: 80px;
        margin-bottom: 24px;
        border-radius: 20px;
        box-shadow: 0 8px 24px rgba(255, 107, 107, 0.3);
        animation: slideDownFade 0.6s ease;
    }

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

    .auth-title,
    h1, h2 {
        font-size: 28px;
        font-weight: 700;
        color: #fff;
        margin: 0 0 8px;
        text-align: center;
        letter-spacing: -0.5px;
    }

    .auth-title span {
        color: #ff6b6b;
    }

    .auth-subtitle,
    .subtitle {
        font-size: 14px;
        color: #9ca3af;
        text-align: center;
        margin: 0 0 32px;
        line-height: 1.5;
    }

    /* ================================================================
       FORM STYLING
       ================================================================ */
    .auth-form,
    .login-form,
    .register-form,
    form {
        width: 100%;
        max-width: 380px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: #e0e9f3;
        margin-bottom: 8px;
        letter-spacing: 0.3px;
        text-transform: uppercase;
    }

    /* ================================================================
       INPUT FIELDS - MODERN & ACCESSIBLE
       ================================================================ */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    .form-control,
    .input-field {
        width: 100%;
        padding: 14px 16px;
        background: rgba(255, 107, 107, 0.05);
        border: 1.5px solid rgba(255, 107, 107, 0.2);
        border-radius: 12px;
        color: #e0e9f3;
        font-size: 16px;
        font-family: inherit;
        transition: all 0.3s ease;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }

    input[type="text"]::placeholder,
    input[type="email"]::placeholder,
    input[type="password"]::placeholder,
    textarea::placeholder {
        color: #6b7280;
    }

    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="password"]:focus,
    input[type="number"]:focus,
    textarea:focus,
    .form-control:focus,
    .input-field:focus {
        outline: none;
        background: rgba(255, 107, 107, 0.08);
        border-color: rgba(255, 107, 107, 0.4);
        box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
    }

    /* Remove number spinner on mobile */
    input[type="number"]::-webkit-outer-spin-button,
    input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    /* ================================================================
       BUTTONS - PROFESSIONAL & LARGE FOR TOUCH
       ================================================================ */
    button,
    .btn,
    .submit-btn,
    input[type="submit"] {
        width: 100%;
        min-height: 50px;
        padding: 14px 24px;
        background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
        -webkit-appearance: none;
        appearance: none;
    }

    button:active,
    .btn:active,
    .submit-btn:active,
    input[type="submit"]:active {
        transform: scale(0.98);
        box-shadow: 0 2px 6px rgba(255, 107, 107, 0.2);
    }

    button:disabled,
    .btn:disabled,
    input[type="submit"]:disabled {
        background: #6b7280;
        opacity: 0.6;
        cursor: not-allowed;
        transform: scale(1);
    }

    /* ================================================================
       SECONDARY BUTTONS & LINKS
       ================================================================ */
    .btn-secondary,
    .btn-ghost {
        background: rgba(255, 107, 107, 0.1);
        color: #ff6b6b;
        border: 1.5px solid rgba(255, 107, 107, 0.3);
        box-shadow: none;
    }

    .btn-secondary:active,
    .btn-ghost:active {
        background: rgba(255, 107, 107, 0.2);
    }

    a {
        color: #ff6b6b;
        text-decoration: none;
        transition: color 0.2s ease;
    }

    a:active {
        color: #ff5252;
    }

    /* ================================================================
       FORM HELPERS & MESSAGES
       ================================================================ */
    .error-message,
    .alert-danger,
    .form-error,
    .invalid-feedback {
        color: #ff6b6b;
        font-size: 12px;
        margin-top: 6px;
        display: block;
        animation: shake 0.3s ease;
    }

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

    .success-message,
    .alert-success {
        color: #22c55e;
        font-size: 12px;
        margin-top: 6px;
        display: block;
    }

    /* ================================================================
       CHECKBOXES & RADIO BUTTONS - MOBILE FRIENDLY
       ================================================================ */
    input[type="checkbox"],
    input[type="radio"] {
        margin-right: 8px;
        cursor: pointer;
        width: 18px;
        height: 18px;
        -webkit-appearance: none;
        appearance: none;
        background: rgba(255, 107, 107, 0.1);
        border: 1.5px solid rgba(255, 107, 107, 0.3);
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    input[type="radio"] {
        border-radius: 50%;
    }

    input[type="checkbox"]:checked,
    input[type="radio"]:checked {
        background: #ff6b6b;
        border-color: #ff6b6b;
    }

    input[type="checkbox"]:checked::after {
        content: '✓';
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: bold;
    }

    /* ================================================================
       FORM FOOTER & LINKS
       ================================================================ */
    .auth-footer {
        text-align: center;
        margin-top: 24px;
        font-size: 13px;
        color: #9ca3af;
    }

    .auth-footer a {
        color: #ff6b6b;
        font-weight: 600;
    }

    .auth-footer-divider {
        margin: 24px 0;
        text-align: center;
        font-size: 12px;
        color: #6b7280;
    }

    .auth-footer-divider::before,
    .auth-footer-divider::after {
        content: '';
        display: inline-block;
        width: 30%;
        height: 1px;
        background: rgba(255, 107, 107, 0.2);
        vertical-align: middle;
        margin: 0 8px;
    }

    /* ================================================================
       SOCIAL LOGIN / OAUTH BUTTONS
       ================================================================ */
    .oauth-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-top: 20px;
    }

    .oauth-btn {
        padding: 12px 16px;
        background: rgba(255, 107, 107, 0.08);
        border: 1px solid rgba(255, 107, 107, 0.15);
        border-radius: 10px;
        color: #e0e9f3;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.3s ease;
        min-height: 44px;
    }

    .oauth-btn:active {
        background: rgba(255, 107, 107, 0.15);
        border-color: rgba(255, 107, 107, 0.3);
    }

    .oauth-btn svg {
        width: 18px;
        height: 18px;
    }

    /* ================================================================
       LOADING STATES
       ================================================================ */
    .loading {
        position: relative;
        color: transparent;
    }

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

    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    /* ================================================================
       TABS FOR AUTH FLOW
       ================================================================ */
    .auth-tabs {
        display: flex;
        gap: 0;
        margin-bottom: 24px;
        border-bottom: 1px solid rgba(255, 107, 107, 0.15);
    }

    .auth-tab-btn {
        flex: 1;
        padding: 12px;
        background: none;
        border: none;
        color: #6b7280;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        position: relative;
        transition: color 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .auth-tab-btn:active,
    .auth-tab-btn.active {
        color: #ff6b6b;
    }

    .auth-tab-btn.active::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        right: 0;
        height: 2px;
        background: #ff6b6b;
    }

    /* ================================================================
       SECURITY BADGES & INFORMATION
       ================================================================ */
    .security-info,
    .info-box {
        background: rgba(34, 197, 94, 0.08);
        border: 1px solid rgba(34, 197, 94, 0.2);
        border-radius: 10px;
        padding: 12px 14px;
        font-size: 12px;
        color: #22c55e;
        margin-bottom: 16px;
        display: flex;
        align-items: flex-start;
        gap: 8px;
    }

    .security-info svg,
    .info-box svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .warning-info {
        background: rgba(245, 158, 11, 0.08);
        border-color: rgba(245, 158, 11, 0.2);
        color: #f59e0b;
    }

    /* ================================================================
       STEP INDICATORS
       ================================================================ */
    .progress-steps {
        display: flex;
        justify-content: space-between;
        margin-bottom: 24px;
        gap: 8px;
    }

    .progress-step {
        flex: 1;
        height: 4px;
        background: rgba(255, 107, 107, 0.15);
        border-radius: 2px;
        overflow: hidden;
    }

    .progress-step.active {
        background: #ff6b6b;
    }

    /* ================================================================
       VERIFICATION CODE INPUT (PASSWORD RESET, 2FA)
       ================================================================ */
    .verification-code-input {
        display: flex;
        gap: 8px;
        justify-content: center;
        margin: 24px 0;
    }

    .verification-code-input input {
        width: 48px;
        height: 48px;
        text-align: center;
        font-size: 24px;
        font-weight: 700;
        max-length: 1;
    }

    /* ================================================================
       PASSWORD STRENGTH INDICATOR
       ================================================================ */
    .password-strength {
        margin-top: 8px;
    }

    .strength-bar {
        height: 4px;
        background: rgba(255, 107, 107, 0.15);
        border-radius: 2px;
        overflow: hidden;
        margin-bottom: 4px;
    }

    .strength-bar-inner {
        height: 100%;
        width: 0%;
        background: #ff6b6b;
        transition: width 0.3s ease, background 0.3s ease;
    }

    .strength-bar-inner.weak { width: 25%; background: #ef4444; }
    .strength-bar-inner.fair { width: 50%; background: #f59e0b; }
    .strength-bar-inner.good { width: 75%; background: #3b82f6; }
    .strength-bar-inner.strong { width: 100%; background: #22c55e; }

    .strength-text {
        font-size: 11px;
        color: #6b7280;
    }

    /* ================================================================
       RESPONSIVE SPACING
       ================================================================ */
    @media (max-height: 600px) {
        .auth-container,
        .login-container,
        .register-container {
            justify-content: flex-start;
            padding-top: 20px;
        }

        .auth-logo {
            width: 60px;
            height: 60px;
            margin-bottom: 16px;
        }

        .auth-title {
            font-size: 24px;
        }

        .auth-subtitle {
            margin-bottom: 20px;
        }

        button {
            min-height: 44px;
        }
    }
}

/* ================================================================
   DESKTOP: HIDE MOBILE STYLING
   ================================================================ */
@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}
