/**
 * Authentication Pages Styles
 * Modern login, OTP verification, and registration pages
 * 
 * @package DSP\Auth
 */

/* ============================================
   CSS Reset for Auth Pages
   ============================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --dsp-maroon: #9b0058;
    --dsp-maroon-light: #c41a7d;
    --dsp-maroon-dark: #7a0046;
    --dsp-gray: #4c565c;
    --dsp-gray-light: #6c757d;
    --dsp-success: #10b981;
    --dsp-danger: #ef4444;
    --dsp-warning: #f59e0b;
}

/* ============================================
   Auth Page Base Styles
   ============================================ */

.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #63545e 0%, #323e48 50%, var(--dsp-maroon) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    padding: 20px;
    margin: 0;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ============================================
   Floating Particles Background
   ============================================ */

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 15s infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 20s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: 2s;
    animation-duration: 25s;
}

.particle:nth-child(3) {
    left: 30%;
    animation-delay: 4s;
    animation-duration: 18s;
}

.particle:nth-child(4) {
    left: 40%;
    animation-delay: 1s;
    animation-duration: 22s;
}

.particle:nth-child(5) {
    left: 50%;
    animation-delay: 3s;
    animation-duration: 19s;
}

.particle:nth-child(6) {
    left: 60%;
    animation-delay: 5s;
    animation-duration: 21s;
}

.particle:nth-child(7) {
    left: 70%;
    animation-delay: 2s;
    animation-duration: 24s;
}

.particle:nth-child(8) {
    left: 80%;
    animation-delay: 4s;
    animation-duration: 17s;
}

.particle:nth-child(9) {
    left: 90%;
    animation-delay: 1s;
    animation-duration: 23s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   Login Container & Card
   ============================================ */

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Header Section
   ============================================ */

.login-header {
    background: linear-gradient(135deg, var(--dsp-maroon) 0%, var(--dsp-maroon-dark) 100%);
    padding: 32px 32px 40px;
    text-align: center;
    position: relative;
}

.login-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 30px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-bottom: 16px;
}

.logo-container img {
    width: 52px;
    height: auto;
    object-fit: contain;
}

.login-header h1 {
    color: white;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.login-header p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    margin: 0;
    font-weight: 400;
}

/* ============================================
   Body Section
   ============================================ */

.login-body {
    padding: 24px 32px 32px;
}

/* ============================================
   Step Indicator
   ============================================ */

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step.active {
    background: var(--dsp-maroon);
    color: white;
    box-shadow: 0 4px 12px rgba(155, 0, 88, 0.35);
}

.step.completed {
    background: var(--dsp-success);
    color: white;
}

.step.inactive {
    background: #e5e7eb;
    color: #9ca3af;
}

.step-line {
    width: 50px;
    height: 3px;
    background: #e5e7eb;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.step-line.active {
    background: var(--dsp-maroon);
}

/* ============================================
   Form Styles
   ============================================ */

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

.auth-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--dsp-gray);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    transition: all 0.2s ease;
    outline: none;
}

.auth-form-control:focus {
    border-color: var(--dsp-maroon);
    background: white;
    box-shadow: 0 0 0 3px rgba(155, 0, 88, 0.1);
}

.auth-form-control::placeholder {
    color: #9ca3af;
}

.auth-form-control.error {
    border-color: var(--dsp-danger);
    background: #fef2f2;
}

/* ============================================
   OTP Input Special Styling
   ============================================ */

.otp-input-group {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.otp-input {
    width: 44px;
    height: 52px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    transition: all 0.2s ease;
    outline: none;
}

.otp-input:focus {
    border-color: var(--dsp-maroon);
    background: white;
    box-shadow: 0 0 0 3px rgba(155, 0, 88, 0.1);
    transform: scale(1.02);
}

.otp-input.filled {
    border-color: var(--dsp-maroon);
    background: white;
}

/* ============================================
   Button Styles
   ============================================ */

.btn-auth-primary {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: linear-gradient(135deg, var(--dsp-maroon) 0%, var(--dsp-maroon-dark) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-auth-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-auth-primary:hover::before {
    left: 100%;
}

.btn-auth-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(155, 0, 88, 0.35);
}

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

.btn-auth-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-auth-primary:disabled:hover {
    box-shadow: none;
}

/* ============================================
   Spinner
   ============================================ */

.auth-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Alert Messages
   ============================================ */

.auth-alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.auth-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.auth-alert i {
    font-size: 16px;
    flex-shrink: 0;
}

/* ============================================
   Email Display
   ============================================ */

.email-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 16px;
}

.email-display i {
    color: var(--dsp-maroon);
    font-size: 16px;
    flex-shrink: 0;
}

.email-display span {
    font-size: 13px;
    color: var(--dsp-gray);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-display .change-email {
    color: var(--dsp-maroon);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.email-display .change-email:hover {
    opacity: 0.8;
}

/* ============================================
   Resend OTP
   ============================================ */

.resend-container {
    text-align: center;
    margin-top: 16px;
}

.resend-text {
    font-size: 13px;
    color: var(--dsp-gray-light);
}

.resend-link {
    color: var(--dsp-maroon);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.resend-link:hover {
    opacity: 0.8;
}

.resend-link.disabled {
    color: #9ca3af;
    pointer-events: none;
}

/* ============================================
   Footer
   ============================================ */

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.login-footer p {
    margin: 0;
}

.login-footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

/* ============================================
   Animations
   ============================================ */

.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Hide/Show Helpers
   ============================================ */

.hidden {
    display: none !important;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
    .auth-page {
        padding: 16px;
    }

    .login-container {
        max-width: 100%;
    }

    .login-header {
        padding: 24px 24px 32px;
    }

    .login-header h1 {
        font-size: 20px;
    }

    .login-body {
        padding: 20px 24px 28px;
    }

    .logo-container {
        width: 64px;
        height: 64px;
    }

    .logo-container img {
        width: 44px;
    }

    .otp-input {
        width: 40px;
        height: 48px;
        font-size: 18px;
    }

    .otp-input-group {
        gap: 6px;
    }

    .step {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .step-line {
        width: 40px;
    }
}

/* Icon animations */
.icon-bounce {
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* ============================================
   Remember Me Checkbox Styles
   ============================================ */

.remember-me-container {
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remember-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 10px;
}

.remember-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.remember-checkbox .checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remember-checkbox:hover .checkmark {
    border-color: var(--dsp-maroon-light);
}

.remember-checkbox input:checked~.checkmark {
    background-color: var(--dsp-maroon);
    border-color: var(--dsp-maroon);
}

.remember-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.remember-checkbox input:checked~.checkmark:after {
    display: block;
}

.remember-checkbox .remember-text {
    font-size: 14px;
    color: var(--dsp-gray);
    font-weight: 500;
}

@media (max-width: 480px) {
    .remember-checkbox .remember-text {
        font-size: 13px;
    }

    .remember-checkbox .checkmark {
        height: 18px;
        width: 18px;
    }

    .remember-checkbox .checkmark:after {
        left: 5px;
        top: 1px;
        width: 4px;
        height: 9px;
    }
}