/* =============================================
   LOGIN PAGE STYLES - PLNE RESPONZÍVNY
   VERZIA: 3.0.0 (Clamp, fluid typography, všetky zariadenia)
   ============================================= */

/* =============================================
   GLOBÁLNE RESET A PREMENNÉ
   ============================================= */
:root {
    --login-container-max-width: 500px;
    --login-container-padding: clamp(1rem, 5vw, 3rem);
    --login-card-padding: clamp(1.25rem, 4vw, 2.5rem);
    --login-font-size-base: clamp(0.813rem, 4vw, 1rem);
    --login-font-size-title: clamp(1.3rem, 6vw, 2.5rem);
    --login-font-size-btn: clamp(0.813rem, 3.5vw, 1.125rem);
    --login-input-padding: clamp(0.625rem, 3vw, 1rem);
    --login-gap: clamp(0.875rem, 4vw, 2rem);
}

/* =============================================
   HLAVNÝ KONTAJNER - FLUIDNÁ ŠÍRKA
   ============================================= */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: var(--login-container-padding);
    width: 100%;
}

.compact-login {
    width: 100%;
    max-width: var(--login-container-max-width);
    margin: 0 auto;
}

/* =============================================
   CONTAINER HEADER
   ============================================= */
.container-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: clamp(1.5rem, 6vw, 3.75rem) clamp(0.75rem, 4vw, 2rem);
    text-align: center;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: var(--login-gap);
    width: 100%;
}

.container-title {
    font-size: var(--login-font-size-title);
    font-weight: 800;
    margin-bottom: clamp(0.5rem, 3vw, 1.25rem);
    line-height: 1.2;
    word-break: break-word;
}

.welcome-message {
    text-align: center;
    font-size: clamp(0.813rem, 3.5vw, 1.125rem);
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
}

.welcome-highlight {
    color: var(--primary-light);
    font-weight: 700;
}

/* =============================================
   LOGIN FORMULÁR - KARTA
   ============================================= */
.compact-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: var(--login-card-padding);
    box-shadow: var(--shadow);
    transition: var(--transition);
    width: 100%;
}

.compact-form:hover {
    box-shadow: var(--shadow-hover);
}

/* =============================================
   FORMULÁROVÉ SKUPINY A INPUTY
   ============================================= */
.form-group {
    margin-bottom: clamp(0.875rem, 4vw, 1.5rem);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: clamp(0.688rem, 3vw, 0.875rem);
    letter-spacing: 0.5px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: clamp(0.625rem, 3vw, 1rem);
    font-size: clamp(0.875rem, 4vw, 1.125rem);
    color: var(--primary-color);
    pointer-events: none;
    z-index: 1;
}

.half-width-input {
    width: 100%;
    padding: var(--login-input-padding);
    padding-left: clamp(1.75rem, 8vw, 3rem);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: var(--login-font-size-base);
    transition: var(--transition);
    font-family: inherit;
    box-sizing: border-box;
    background: var(--white);
    color: var(--text-dark);
}

.half-width-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(74, 100, 212, 0.1);
    transform: translateY(-1px);
}

/* Autofill štýly */
.half-width-input:-webkit-autofill,
.half-width-input:-webkit-autofill:hover,
.half-width-input:-webkit-autofill:focus,
.half-width-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--white) inset !important;
    box-shadow: 0 0 0 30px var(--white) inset !important;
}

/* =============================================
   PASSWORD KONTAJNER A TOGGLE
   ============================================= */
.password-container {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: clamp(0.625rem, 3vw, 1rem);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: clamp(0.875rem, 4vw, 1.125rem);
    padding: 0.5rem;
    z-index: 2;
    transition: var(--transition);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-50%) scale(1.1);
}

/* =============================================
   CHECKBOX KONTAJNER
   ============================================= */
.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    flex-wrap: wrap;
}

.checkbox-container input {
    width: clamp(0.875rem, 4vw, 1.125rem);
    height: clamp(0.875rem, 4vw, 1.125rem);
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-container label {
    margin-bottom: 0;
    cursor: pointer;
    font-size: clamp(0.688rem, 3vw, 0.875rem);
    color: var(--text-muted);
}

/* =============================================
   SUBMIT TLAČIDLO
   ============================================= */
.compact-submit-btn {
    width: 100%;
    padding: var(--login-input-padding);
    font-size: var(--login-font-size-btn);
    font-weight: 700;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.compact-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 43, 110, 0.3);
}

.compact-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* =============================================
   REGISTER LINK
   ============================================= */
.register-link {
    text-align: center;
    margin-top: clamp(1.25rem, 5vw, 2rem);
    padding-top: clamp(0.875rem, 4vw, 1.25rem);
    border-top: 1px solid var(--border-light);
}

.register-link p {
    margin: 0.5rem 0;
    color: var(--text-muted);
    font-size: clamp(0.688rem, 3vw, 0.875rem);
}

.register-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.register-link a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* =============================================
   SECURITY WARNING BOX
   ============================================= */
.security-warning-box {
    background: var(--warning-light);
    border-left: 4px solid var(--warning-color);
    padding: clamp(0.625rem, 3vw, 1rem);
    margin-top: 1rem;
    border-radius: var(--radius-xs);
    display: none;
    font-size: clamp(0.688rem, 3vw, 0.875rem);
}

.security-warning-box.show {
    display: block;
    animation: slideIn 0.3s ease;
}

/* =============================================
   ATTEMPTS COUNTER
   ============================================= */
.attempts-counter {
    text-align: right;
    font-size: clamp(0.625rem, 2.5vw, 0.75rem);
    margin-top: 0.25rem;
    color: var(--text-muted);
}

.attempts-counter.warning {
    color: var(--warning-color);
    font-weight: 600;
}

.attempts-counter.danger {
    color: var(--danger-color);
    font-weight: 700;
}

/* =============================================
   ANIMÁCIE
   ============================================= */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* =============================================
   INPUT VALIDATION
   ============================================= */
.input-error {
    border-color: var(--danger-color) !important;
    background-color: var(--danger-light);
}

.input-success {
    border-color: var(--success-color) !important;
}

/* =============================================
   SECURITY BADGE
   ============================================= */
.security-badge {
    position: fixed;
    bottom: clamp(0.5rem, 2vw, 1.25rem);
    right: clamp(0.5rem, 2vw, 1.25rem);
    background: rgba(26, 43, 110, 0.9);
    color: white;
    padding: clamp(0.25rem, 2vw, 0.5rem) clamp(0.5rem, 3vw, 1rem);
    border-radius: 20px;
    font-size: clamp(0.563rem, 2.5vw, 0.75rem);
    z-index: 1000;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* =============================================
   LOADING SPINNER
   ============================================= */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(1.75rem, 8vw, 3rem);
    height: clamp(1.75rem, 8vw, 3rem);
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1001;
    display: none;
}
/* =============================================
   DOPLNOK DO login.css PRE KEYBOARD A MOBILY
   ============================================= */

/* Prispôsobenie pri otvorení klávesnice na mobile */
.login-container.keyboard-open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Lepšie dotykové ciele pre mobilné zariadenia */
@media (max-width: 768px) {
    .compact-submit-btn,
    .register-link a,
    .password-toggle,
    .checkbox-container {
        min-height: 44px; /* Apple požiadavka na minimálnu veľkosť dotykového cieľa */
    }

    .password-toggle {
        min-width: 44px;
    }

    .checkbox-container input {
        min-width: 44px;
        min-height: 44px;
    }
}

/* SCROLLBAR PRE MOBILNÉ PREHLIADAČE */
@media (max-width: 768px) {
    .login-container {
        scrollbar-width: thin;
    }

    .login-container::-webkit-scrollbar {
        width: 4px;
    }

    .login-container::-webkit-scrollbar-track {
        background: var(--border-light);
    }

    .login-container::-webkit-scrollbar-thumb {
        background: var(--primary-light);
        border-radius: 4px;
    }
}
/* =============================================
   RESPONZÍVNE ŠTÝLY
   ============================================= */
@media (max-width: 768px) {
    .checkbox-container {
        flex-direction: column;
        text-align: center;
    }
    .register-link p {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    .security-badge {
        bottom: 0.5rem;
        right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .compact-form {
        padding: 1.25rem;
    }
    .half-width-input {
        padding: 0.625rem 0.625rem 0.625rem 2.25rem;
    }
    .input-icon {
        left: 0.625rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 360px) {
    .compact-form {
        padding: 1rem;
    }
    .container-title {
        font-size: 1.2rem;
    }
}

/* =============================================
   DARK MODE
   ============================================= */
@media (prefers-color-scheme: dark) {
    .compact-form {
        background: var(--bg-primary);
    }
    .half-width-input {
        background: var(--bg-secondary);
        border-color: var(--border-default);
        color: var(--text-primary);
    }
    .half-width-input:focus {
        background: var(--bg-primary);
    }
    .half-width-input:-webkit-autofill {
        -webkit-box-shadow: 0 0 0 30px var(--bg-secondary) inset !important;
    }
}

/* =============================================
   ZNÍŽENÁ POHYBLIVOSŤ
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .compact-submit-btn:hover {
        transform: none;
    }
}
