/*
 * Soubor: authentication.css
 * Ucel: Prihlaseni, uzivatelsky panel a SMS overeni
 * Hranice: Neobsahuje tabulku a modaly spravy uzivatelu
 *
 * @version 1.0.0 2026-07-25
 * @changelog 1.0.0 2026-07-25
 *  - autentizacni styly oddeleny z puvodniho screen.css
 */

/*formular prihlaseni*/

.login-container {
    max-width: 420px;
    margin: 4rem auto;
    padding: 2.5rem;
    background: #ffffff;
    border: 1px solid #e0e6eb; /* přidán jemný rámeček */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); /* zvýrazněn stín */
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
}

.login-container h2 {
    text-align: center;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 2rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #444;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: border-color 0.2s;
    font-size: 1rem;
}

.form-group input:focus {
    border-color: #00b7c2;
    outline: none;
    background-color: #eefbfc;
}

.login-button {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(to right, #00c4cc, #00a3b8);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.login-button:hover {
    background: linear-gradient(to right, #009da8, #007f91);
}

.login-error, .edit-error, .add_user-error{
    background-color: #ffe0e0;
    color: #a94442;
    padding: 0.8rem;
    margin-bottom: 1.5rem;
    border: 1px solid #f5c2c2;
    border-radius: 6px;
    text-align: center;
}


.login-success, .edit-success, .add_user-success {
    background-color: #e0ffe4;
    color: #2e7d32;
    padding: 0.8rem;
    margin-bottom: 1.5rem;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}


.edit-success, .add_user-success{
    animation: successShadowPulse 0.9s ease-out 1;
}

@keyframes successShadowPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); /* zelenkavý glow */
    }
    60% {
        box-shadow: 0 0 0 14px rgba(34, 197, 94, 0); /* rozplyne se do ztracena */
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.edit-error, .add_user-error {
    animation: errorShadowPulse 0.9s ease-out 1;
}

@keyframes errorShadowPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45);   /* červený glow */
    }
    60% {
        box-shadow: 0 0 0 14px rgba(239, 68, 68, 0);  /* rozplyne se do ztracena */
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}


/*okénko ukazující přihlášeného uživatele */

/* wrapper vpravo */
.userbar{
    position: fixed;       /* nebo absolute, pokud máš header jako positioning context */
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}


.uzivatel-dropdown,
.admin-dropdown {
    position: relative;
    top: 1rem;
    right: 1rem;
    z-index: 999;
    font-family: sans-serif;
}

.uzivatel-trigger,
.admin-trigger {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.uzivatel-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background: white;
    border: 1px solid #ccc;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    min-width: 8rem;
    z-index: 9999;
}

.uzivatel-dropdown:focus-within .uzivatel-menu {
    display: block;
}

.uzivatel-menu form {
    margin: 0;
}

.uzivatel-menu a,
.uzivatel-menu button {
    text-decoration: none;
    color: #007bff;
    font-weight: 500;
    display: block;
    padding: 0.25rem 0;
    text-align: center;
}

.uzivatel-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.uzivatel-menu a:hover,
.uzivatel-menu button:hover {
    text-decoration: underline;
}





/*možnosti pro správce: */
/* menu – admin (stejné zaoblení & stín) */
.admin-menu{
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 200px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 6px 0;
    box-shadow: var(--menu-shadow);
    z-index: 9999;
}
.admin-menu a{
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}
.admin-menu a:hover{
    background: #f5f5f5;
}



/*form pro ověřování SMS */
/* Kontejner celého ověřovacího formuláře */
.sms-overeni-form-wrap {
    max-width: 420px;
    margin: 3rem auto;
    padding: 2rem;
    background-color: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Základní odstavec */
.sms-overeni-form-wrap p {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.2rem;
}

/* Skupiny formulářových prvků */
.form-group-sms {
    margin-bottom: 1.5rem;
}

/* Štítky */
.form-group-sms label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}

/* Vstupní pole */
.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    outline: none;
}

/* Tlačítko pro odeslání */
.btn.btn-primary {
    background-color: #007bff;
    color: #fff;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.btn.btn-primary:hover {
    background-color: #0056b3;
}

/* Chybová hláška */
.sms-error {
    background-color: #fbeaea;
    color: #b00;
    border: 1px solid #e0b4b4;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    font-size: 0.95rem;
}

/* Informační část s časem expirace */
.sms-info {
    text-align: center;
    font-size: 0.95rem;
    color: #555;
    margin-top: 1rem;
}

#sms-expirace-timer {
    font-weight: bold;
    /*color: #007bff;*/
}


.countdown-box {
    font-size: 1.5rem;
    font-weight: 600;
    color: #007bff;
    transition: color 0.4s ease;
    text-align: center;
    padding: 0.3rem 0;
}

@keyframes subtlePulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.95;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes intensePulse {
    0%, 100% {
        transform: scale(1);
        color: #c0392b;
    }
    50% {
        transform: scale(1.05);
        color: #ff0000;
    }
}

.countdown-box.warning {
    color: #e67e22 !important;
    animation: subtlePulse 1.5s ease-in-out infinite;
}

.countdown-box.danger {
    color: #c0392b !important;
    animation: intensePulse 0.8s ease-in-out infinite;
}

#sms-expirace-timer.expired {
    color: #c0392b !important;
}

.resend-btn {
    background-color: #ffffff;
    color: #007bff;
    border: 1px solid #007bff;
    border-radius: 6px;
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    display: inline-block;
}

.resend-button-box {
    position: relative;
    display: inline-block;
}
.resend-btn-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.resend-btn:hover {
    background-color: #007bff;
    color: #ffffff;
}

.resend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
    border-color: #ccc;
    color: #aaa;
    cursor: default;
}

#resend-wrapper {
    margin-top: 1rem;
    text-align: center;
}


.cooldown-note {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

.resend-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    position: relative;
}

.resend-confirmation {
    display: none;
    margin-top: 1rem;
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
    animation: pulseFade 1.5s ease-in-out infinite;
}


@keyframes pulseFade {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.sms-error.pulse {
    animation: pulseError 1.2s ease;
}

@keyframes pulseError {
    0%   {
        background-color: #fdd;
    }
    50%  {
        background-color: #fbb;
    }
    100% {
        background-color: #fdd;
    }
}

.back-to-login {
    margin-top: 1.5rem;
    text-align: left;
}

.back-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #007bff;
    background: none;
    border: none;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-link-btn:hover {
    color: #0056b3;
    text-decoration: underline;
}

.back-link-btn .icon-left {
    stroke: #007bff;
    transition: stroke 0.3s ease;
}

.back-link-btn:hover .icon-left {
    stroke: #0056b3;
}


