﻿/* auth.css - Login, Register, Password Reset - DARK THEME */

/* ---- AUTH CONTAINER ---- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* ---- AUTH CARD ---- */
.auth-card {
    background: rgba(16, 16, 26, 0.85); /* Lekko przezroczyste */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--border-radius);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

    .auth-card::before {
        content: none;
    }

    .auth-card * {
        position: relative;
        z-index: 2;
    }

    /* ---- AUTH TYPOGRAPHY ---- */
    .auth-card h1 {
        text-align: center;
        font-size: 2.5rem;
        margin-bottom: 0;
        background: linear-gradient(90deg, #667eea 0%, #00d9ff 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .auth-card h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
        color: var(--text-primary);
        text-align: center;
    }

    /* ---- AUTH FORMS ---- */
    .auth-card .form-group {
        position: relative;
        margin-bottom: 1.5rem;
    }

    .auth-card label {
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 0.5rem;
        display: block;
    }

    .auth-card .form-control {
        padding-left: 3rem;
        padding-right: 1rem;
        height: 50px;
        font-size: 1rem;
        background: rgba(10, 10, 15, 0.8) !important;
        color: #ffffff !important;
        border: 1px solid rgba(102, 126, 234, 0.3) !important;
    }

    .auth-card .form-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: #667eea;
        font-size: 1.2rem;
        z-index: 3;
        pointer-events: none;
    }

    /* ---- AUTH BUTTONS ---- */
    .auth-card .btn {
        width: 100%;
        margin-top: 1rem;
    }

    .auth-card .btn-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        padding: 1rem 2rem;
        font-size: 1.1rem;
        font-weight: 600;
        letter-spacing: 1px;
        text-transform: uppercase;
        border-radius: 50px;
        color: #ffffff;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        transition: all var(--transition-fast);
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    }

        .auth-card .btn-primary:hover {
            transform: translateY(-3px);
            box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
        }

/* ---- AUTH LINKS ---- */
.auth-links {
    text-align: center;
    margin-top: 2rem;
    position: relative;
    z-index: 5;
}

    .auth-links a {
        color: #667eea;
        font-weight: 500;
        text-decoration: none;
        display: inline-block;
        padding: 0.5rem 1rem;
        transition: all var(--transition-fast);
    }

        .auth-links a:hover {
            color: #00d9ff;
            text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
        }

/* ---- PARTICLES BACKGROUND ---- */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: fixed;
    pointer-events: none;
    width: 2px;
    height: 2px;
    background: #667eea;
    border-radius: 50%;
    opacity: 0.6;
}

/* ---- AUTH PAGE BACKGROUND - DESKTOP ---- */
body.auth-page {
    overflow: hidden;
    min-height: 100vh;
    position: relative;
    background: #0a0a0f; /* Fallback color */
}

    /* Obrazek tła */
    body.auth-page::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -2;
        background-image: url('/images/background.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }

    /* JAŚNIEJSZY overlay dla desktop - żeby było widać tło */
    body.auth-page::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -1;
        background: linear-gradient( rgba(10, 10, 15, 0.4), /* Jaśniejszy na górze */
        rgba(10, 10, 15, 0.6) /* Trochę ciemniejszy na dole */
        );
    }

/* ---- REMEMBER ME SECTION ---- */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

    .remember-forgot a {
        color: #667eea;
        font-size: 0.9rem;
    }

        .remember-forgot a:hover {
            color: #00d9ff;
        }

/* ---- GOOGLE BUTTON ---- */
.btn-google {
    background: linear-gradient(135deg, #4285f4 0%, #357ae8 100%);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .3s;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-small);
    font-weight: 600;
    margin-top: 1rem;
}

    .btn-google:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(66,133,244,.4);
    }

/* ---- CHECKBOX STYLING ---- */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

    .custom-checkbox input[type="checkbox"] {
        display: none;
    }

.checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 3px;
    background: rgba(10, 10, 15, 0.4);
    position: relative;
    transition: all var(--transition-fast);
    margin-right: 0;
    flex-shrink: 0;
}

    .checkmark::after {
        content: '';
        position: absolute;
        top: 1px;
        left: 4px;
        width: 3px;
        height: 6px;
        border: solid #FFFFFF;
        border-width: 0 1.5px 1.5px 0;
        transform: rotate(45deg) scale(0);
        transition: transform 0.2s ease;
    }

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

    .custom-checkbox input[type="checkbox"]:checked + .checkmark::after {
        transform: rotate(45deg) scale(1);
    }

/* ---- INPUTS OVERRIDE ---- */
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="tel"],
.auth-card input[type="number"],
.auth-card textarea,
.auth-card select {
    background: rgba(10, 10, 15, 0.8) !important;
    color: #ffffff !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

    .auth-card input:focus,
    .auth-card textarea:focus,
    .auth-card select:focus {
        background: rgba(10, 10, 15, 0.9) !important;
        color: #ffffff !important;
        border-color: #667eea !important;
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3) !important;
        outline: none !important;
    }

    .auth-card input::placeholder,
    .auth-card textarea::placeholder {
        color: rgba(255, 255, 255, 0.4) !important;
        opacity: 1 !important;
    }

/* Autofill fix */
.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus,
.auth-card input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #1a1a2e inset !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 0 0 1000px #1a1a2e inset !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

/* Text danger */
.text-danger {
    color: #e94560 !important;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Alert */
.alert-danger {
    background: rgba(233, 69, 96, 0.2) !important;
    border: 1px solid rgba(233, 69, 96, 0.4) !important;
    color: #e94560 !important;
    padding: 1rem;
    border-radius: var(--border-radius-small);
    margin-bottom: 1rem;
}

/* ---- MOBILE RESPONSIVE ---- */
@media (max-width: 768px) {
    /* Tło na mobile - pełna ścieżka */
    body.auth-page {
        background-color: #0a0a0f;
        background-image: url('/images/background.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: scroll; /* iOS fix */
    }

        /* Alternatywne podejście z ::before */
        body.auth-page::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -2;
            background-image: url('/images/background.png');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            -webkit-background-size: cover;
            transform: translateZ(0); /* Hardware acceleration */
        }

        /* Ciemniejszy overlay na mobile dla lepszej czytelności */
        body.auth-page::after {
            background: linear-gradient( rgba(10, 10, 15, 0.7), /* Ciemniejszy na mobile */
            rgba(10, 10, 15, 0.85) );
        }

    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
        background: rgba(16, 16, 26, 0.9) !important; /* Bardziej nieprzezroczyste na mobile */
    }

        .auth-card h1 {
            font-size: 2rem;
        }

        .auth-card h2 {
            font-size: 1.3rem;
        }

        .auth-card .form-control {
            height: 48px;
            font-size: 16px; /* Prevent iOS zoom */
        }

    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* iOS Safari specific */
@supports (-webkit-touch-callout: none) {
    body.auth-page::before {
        position: fixed;
        background-attachment: scroll;
    }

    .auth-card input,
    .auth-card textarea,
    .auth-card select {
        font-size: 16px !important;
    }
}
/* POPRAWKA DLA CHECKBOX - dodaj to na końcu auth.css */

/* ---- REMEMBER ME CHECKBOX FIX ---- */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 0;
    margin: 0;
}

    .custom-checkbox input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
    }

.checkmark {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.4);
    border-radius: 4px;
    background: rgba(10, 10, 15, 0.6);
    transition: all var(--transition-fast);
    margin-right: 8px;
    flex-shrink: 0;
}

    .checkmark::after {
        content: '';
        position: absolute;
        display: none;
        left: 6px;
        top: 2px;
        width: 5px;
        height: 10px;
        border: solid #ffffff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }

.custom-checkbox input[type="checkbox"]:checked ~ .checkmark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

    .custom-checkbox input[type="checkbox"]:checked ~ .checkmark::after {
        display: block;
    }

.custom-checkbox:hover .checkmark {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.checkbox-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.2;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.remember-forgot a {
    color: #667eea;
    font-size: 0.9rem;
    white-space: nowrap;
    text-decoration: none;
}

    .remember-forgot a:hover {
        color: #00d9ff;
    }

/* Mobile responsive */
@media (max-width: 768px) {
    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .custom-checkbox {
        margin-bottom: 0.5rem;
    }

    .checkbox-label {
        font-size: 0.85rem;
    }
}
/* POPRAWKA RESPONSIVE v2: UTRZYMANIE UKŁADU W JEDNEJ LINII 
  (dodaj na końcu auth.css)
*/
@media (max-width: 420px) { /* Działa na bardzo wąskich ekranach */

    .remember-forgot .checkbox-label,
    .remember-forgot a {
        white-space: normal !important; /* POZWALA TEKSTOM SIĘ ZAWIJAĆ */
        font-size: 13px; /* Delikatnie zmniejsza czcionkę */
        line-height: 1.3; /* Poprawia odstęp między liniami po zawinięciu */
    }

    .remember-forgot {
        /* Zapewnia, że elementy nadal mają trochę przestrzeni między sobą */
        gap: 10px;
    }
}
/* Wymuszenie etykiety obok checkboxa */
.custom-checkbox {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}

    .custom-checkbox .checkbox-label {
        white-space: nowrap !important; /* Zapobiega łamaniu tekstu do nowej linii */
    }
/* Style dla logo na stronie logowania */
.auth-logo {
    display: block;
    max-width: 280px;
    width: 100%;
    height: auto;
    margin: 0 auto 2rem auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
    transition: all 0.3s ease;
}

    .auth-logo:hover {
        filter: drop-shadow(0 6px 16px rgba(102, 126, 234, 0.4));
        transform: scale(1.02);
    }

/* Responsive dla logo */
@media (max-width: 768px) {
    .auth-logo {
        max-width: 240px;
        margin-bottom: 1.5rem;
    }

    /* Poprawiona sekcja dla tła na mobile */
    body.auth-page::before {
        background-image: url('../images/background.png') !important;
        background-attachment: scroll !important; /* Ważna poprawka dla iOS */
    }

    /* Dodatkowo, usuwamy obrazek tła z samego body, aby uniknąć konfliktów */
    body.auth-page {
        background-image: none !important;
    }
}

@media (max-width: 480px) {
    .auth-logo {
        max-width: 200px;
        margin-bottom: 1rem;
    }
}

@media (max-width: 360px) {
    .auth-logo {
        max-width: 180px;
    }
}

/* Desktop - jaśniejszy overlay */
@media (min-width: 769px) {
    body.auth-page::after {
        background: linear-gradient( rgba(10, 10, 15, 0.3), rgba(10, 10, 15, 0.5) ) !important;
    }
}

/* Autofill fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0 1000px #1a1a2e inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

@media (max-width: 768px) {
  
    body.auth-page::before {
        background-image: url('../images/background.png') !important;
        background-attachment: scroll !important; 
    }

    
    body.auth-page {
        background-image: none !important;
    }
}

/* Desktop - jaśniejszy overlay */
@media (min-width: 769px) {
    body.auth-page::after {
        background: linear-gradient( rgba(10, 10, 15, 0.3), rgba(10, 10, 15, 0.5) ) !important;
    }
}

/* Autofill fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0 1000px #1a1a2e inset !important;
    transition: background-color 5000s ease-in-out 0s;
}
/* ---- SAML LOADING SPINNER ---- */
#samlLoadingMessage {
    animation: fadeIn 0.3s ease-in;
}

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

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

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

.spinner-border.text-primary {
    color: #667eea !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
