/**
 * ThunderOrders - Login Page Style
 * Dark glassmorphism design with animated background
 */

/* ============================================
   HTML & BODY
   ============================================ */

html.auth-html {
    min-height: 100%;
    background: #302b63;
}

html.auth-html body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 1rem;
    background: #302b63;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ============================================
   FLOATING ORBS - Pseudo elements
   ============================================ */

html.auth-html body::before,
html.auth-html body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}

/* Orb 1 - Pink/Red top-left */
html.auth-html body::before {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    top: 120px;
    left: -100px;
}

/* Orb 2 - Purple/Blue right */
html.auth-html body::after {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    bottom: 100px;
    right: -50px;
    animation-delay: -7s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(30px, 30px);
    }
}


/* ============================================
   GLASS CONTAINER
   ============================================ */

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 1rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: containerGlow 4s ease-in-out infinite alternate;
}

@keyframes containerGlow {
    0% {
        box-shadow:
            0 25px 50px -12px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05) inset,
            0 0 30px rgba(240, 147, 251, 0.1);
    }
    100% {
        box-shadow:
            0 25px 50px -12px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05) inset,
            0 0 30px rgba(102, 126, 234, 0.15);
    }
}

/* ============================================
   LOGO
   ============================================ */

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo img {
    max-width: 350px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}

/* ============================================
   HEADER
   ============================================ */

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.2), rgba(102, 126, 234, 0.2));
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-badge svg {
    opacity: 0.9;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.auth-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   FORM
   ============================================ */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Input Group */
.auth-input-group {
    position: relative;
}

.input-wrapper {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.95rem;
    color: #fff;
    transition: all 0.3s ease;
}

.auth-input::placeholder {
    color: transparent;
}

.auth-input:focus {
    outline: none;
    border-color: rgba(240, 147, 251, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

/* Input Glow Effect */
.input-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(240, 147, 251, 0.3);
}

.auth-input:focus ~ .input-glow {
    opacity: 1;
}

/* Floating Label */
.auth-input-label {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    pointer-events: none;
    background: transparent;
}

.auth-input:focus + .auth-input-label,
.auth-input:not(:placeholder-shown) + .auth-input-label,
.auth-input.has-value + .auth-input-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: rgba(240, 147, 251, 0.9);
    background: rgba(20, 20, 40, 0.95);
    padding: 0 0.5rem;
    left: 1rem;
    border-radius: 4px;
}

/* Autofill handling */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(30, 30, 50, 0.95) inset !important;
    -webkit-text-fill-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #fff;
}

.auth-input:-webkit-autofill + .auth-input-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: rgba(240, 147, 251, 0.9);
    background: rgba(20, 20, 40, 0.95);
    padding: 0 0.5rem;
    left: 1rem;
    border-radius: 4px;
}

/* Password Toggle Button */
.password-toggle-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
    z-index: 2;
}

.password-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.password-toggle-btn.active {
    color: rgba(240, 147, 251, 0.9);
}

/* Form Error */
.form-error {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #f5576c;
    padding-left: 0.25rem;
}

/* ============================================
   OPTIONS ROW (Remember & Forgot)
   ============================================ */

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* Custom Checkbox */
.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
    padding-left: 1.75rem;
}

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

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.auth-remember:hover .checkmark {
    border-color: rgba(240, 147, 251, 0.5);
}

.auth-remember input:checked ~ .checkmark {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: transparent;
}

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

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

.remember-text {
    color: rgba(255, 255, 255, 0.7);
}

/* Forgot Password Link */
.auth-forgot {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s ease;
}

.auth-forgot:hover {
    color: rgba(240, 147, 251, 0.9);
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */

.auth-submit {
    position: relative;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.4);
}

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

/* Button Shine Effect */
.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.auth-submit:hover .btn-shine {
    left: 100%;
}

/* Button Loader */
.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-submit.loading .btn-text {
    display: none;
}

.auth-submit.loading .btn-loader {
    display: block;
}

.auth-submit.loading {
    pointer-events: none;
    opacity: 0.8;
}

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

/* ============================================
   FOOTER
   ============================================ */

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.register-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(240, 147, 251, 0.9);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.register-link:hover {
    color: #fff;
    gap: 0.75rem;
}

.register-link svg {
    transition: transform 0.3s ease;
}

.register-link:hover svg {
    transform: translateX(3px);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    html.auth-html body {
        padding: 0.5rem;
    }

    .auth-container {
        padding: 2rem 1.5rem;
        border-radius: 20px;
        margin: 1rem;
        animation: none;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    /* Wyłącz kosztowne animacje na mobile - oszczędność baterii */
    html.auth-html body::before,
    html.auth-html body::after {
        animation: none;
        filter: blur(40px);
        opacity: 0.3;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    html.auth-html body::before,
    html.auth-html body::after {
        animation: none;
    }

    .auth-container {
        animation: none;
    }

    .btn-shine {
        display: none;
    }
}
