/**
 * Authentication Pages Styling
 * BlazinStreetz Passwordless Authentication System
 *
 * Styles for login, registration, and email verification pages.
 * Follows BlazinStreetz design system with dark theme and red accents.
 *
 * @created 2025-11-18
 */

/* Auth Container */
.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

/* Auth Box */
.auth-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

/* Logo */
.auth-logo-wrapper {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    max-width: 180px;
    height: auto;
}

/* Typography */
.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
    text-align: center;
}

.auth-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0 0 30px 0;
    text-align: center;
}

/* Form */
.magic-link-form {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-control::placeholder {
    color: #999;
}

/* Primary Button */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spinner 0.8s linear infinite;
}

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

/* Form Note */
.form-note {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* Error Messages */
.auth-error,
.auth-error-inline {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #c53030;
    font-size: 14px;
    text-align: center;
}

.auth-error-inline {
    animation: slideDown 0.3s ease-out;
}

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

/* Footer */
.auth-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.auth-footer p {
    font-size: 13px;
    color: #999;
    margin: 0;
}

.auth-footer a {
    color: #e74c3c;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Check Email Page Specific */
.text-center {
    text-align: center;
}

.email-icon {
    margin: 0 auto 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.email-icon svg {
    width: 80px;
    height: 80px;
}

.email-notice {
    font-size: 16px;
    color: #666;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.email-notice strong {
    color: #e74c3c;
    font-weight: 600;
}

.help-text {
    font-size: 15px;
    color: #888;
    margin: 0 0 30px 0;
    line-height: 1.6;
}

.help-text strong {
    color: #333;
}

/* Email Tips */
.email-tips {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    text-align: left;
}

.tips-title {
    font-size: 15px;
    color: #333;
    margin: 0 0 12px 0;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    font-size: 14px;
    color: #666;
    padding: 6px 0 6px 24px;
    position: relative;
}

.tips-list li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: #e74c3c;
    font-weight: bold;
}

/* Auth Actions */
.auth-actions {
    margin: 30px 0 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e74c3c;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: #c0392b;
    gap: 12px;
}

.back-link svg {
    transition: transform 0.2s ease;
}

.back-link:hover svg {
    transform: translateX(-4px);
}

/* Security Notice */
.security-notice {
    background: #fff9e6;
    border-left: 4px solid #f39c12;
    border-radius: 4px;
    padding: 16px;
    margin-top: 24px;
}

.security-notice p {
    font-size: 13px;
    color: #856404;
    margin: 0;
    line-height: 1.5;
}

.security-notice strong {
    color: #533f03;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 20px 15px;
        min-height: calc(100vh - 150px);
    }

    .auth-box {
        padding: 30px 24px;
    }

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

    .auth-logo {
        max-width: 150px;
    }

    .email-icon svg {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .auth-box {
        padding: 24px 20px;
    }

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

    .btn-primary {
        font-size: 15px;
        padding: 12px 20px;
    }
}

/* ============================================
   LOGIN MODAL
   ============================================ */

/* Modal Container */
.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #fff;
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Content */
.auth-modal__content {
    padding: 32px;
}

/* Header */
.auth-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.auth-modal__title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.auth-modal__close {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.auth-modal__close:hover {
    color: #333;
    background: #f5f5f5;
}

/* Body */
.auth-modal__body {
    color: #333;
}

.auth-modal__subtitle {
    font-size: 16px;
    color: #666;
    margin: 0 0 24px;
}

/* Success State */
.auth-modal__success {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    font-size: 64px;
    color: #2ecc71;
    margin-bottom: 16px;
}

.auth-modal__success h4 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px;
}

.auth-modal__success p {
    font-size: 16px;
    color: #666;
    margin: 8px 0;
}

.auth-modal__success .text-muted {
    color: #999;
    font-size: 14px;
}

/* Backdrop */
.auth-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .auth-modal__content {
        padding: 24px;
    }

    .auth-modal__title {
        font-size: 20px;
    }

    .auth-modal__subtitle {
        font-size: 14px;
    }
}

/* ============================================
   OTP AUTHENTICATION
   ============================================ */

/* OTP Forms */
.otp-email-form,
.otp-code-form {
    margin-bottom: 20px;
}

/* OTP Info Section */
.otp-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.otp-sent-to {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.otp-sent-to strong {
    color: #333;
    font-weight: 600;
}

.btn-link {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-link:hover {
    background: rgba(231, 76, 60, 0.1);
    text-decoration: underline;
}

/* OTP Input Field */
.otp-input {
    text-align: center;
    font-size: 32px;
    font-family: 'Courier New', monospace;
    letter-spacing: 8px;
    font-weight: 600;
    padding: 16px;
}

.otp-input::placeholder {
    letter-spacing: 4px;
}

/* OTP Helper Text */
.otp-helper-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
    min-height: 20px;
}

#attempts-remaining {
    color: #666;
}

#attempts-remaining.warning {
    color: #f39c12;
    font-weight: 600;
}

.code-timer {
    color: #2ecc71;
    font-weight: 500;
}

.code-timer.expired {
    color: #e74c3c;
    font-weight: 600;
}

/* Secondary Button (Resend) */
.btn-secondary {
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.btn-secondary:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #d0d0d0;
    color: #333;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success Message */
.auth-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #155724;
    font-size: 14px;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

/* Button Spinner */
.btn-spinner {
    display: inline-block;
}

.btn-spinner i {
    font-size: 16px;
}

/* Mobile OTP Adjustments */
@media (max-width: 576px) {
    .otp-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .otp-input {
        font-size: 28px;
        letter-spacing: 6px;
        padding: 14px;
    }

    .otp-helper-text {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
