/* ========================================
   AUTH POPUP - PŘIHLÁŠENÍ / REGISTRACE
   MOBILE FIRST + BEM
   ======================================== */

/* ========================================
   OVERLAY (tmavé pozadí)
   ======================================== */

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-overlay--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ========================================
   POPUP KONTEJNER
   ======================================== */

.auth-popup {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 20px;
    padding: 32px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.auth-overlay--hidden .auth-popup {
    transform: scale(0.95);
}

/* ========================================
   TLAČÍTKO ZAVŘÍT
   ======================================== */

.auth-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-popup__close:hover {
    background-color: #e5e7eb;
}

.auth-popup__close:active {
    transform: scale(0.95);
}

.auth-popup__close-icon {
    width: 18px;
    height: 18px;
    color: #6b7280;
}

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

.auth-popup__logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-popup__logo-image {
    height: 36px;
    width: auto;
}

/* ========================================
   NADPISY
   ======================================== */

.auth-popup__title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin: 0 0 24px 0;
}

.auth-popup__subtitle {
    font-size: 15px;
    color: #6b7280;
    text-align: center;
    margin: -16px 0 24px 0;
}

/* ========================================
   IKONA ÚSPĚCHU (pro výběr role)
   ======================================== */

.auth-popup__success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
}

.auth-popup__success-icon svg {
    width: 32px;
    height: 32px;
    color: #ffffff;
}

/* ========================================
   SOCIÁLNÍ TLAČÍTKA
   ======================================== */

.auth-popup__social {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-popup__social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Apple */
.auth-popup__social-btn--apple {
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #000000;
}

.auth-popup__social-btn--apple:hover {
    background-color: #1a1a1a;
}

/* Google */
.auth-popup__social-btn--google {
    background-color: #ffffff;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.auth-popup__social-btn--google:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

/* Facebook */
.auth-popup__social-btn--facebook {
    background-color: #1877F2;
    color: #ffffff;
    border: 2px solid #1877F2;
}

.auth-popup__social-btn--facebook:hover {
    background-color: #166fe5;
}

.auth-popup__social-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-popup__social-text {
    flex: 1;
    text-align: center;
}

/* ========================================
   ODDĚLOVAČ
   ======================================== */

.auth-popup__divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-popup__divider::before,
.auth-popup__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #e5e7eb;
}

.auth-popup__divider-text {
    padding: 0 16px;
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
    white-space: nowrap;
}

/* ========================================
   E-MAIL FORMULÁŘ
   ======================================== */

.auth-popup__form {
    width: 100%;
}

.auth-popup__field {
    width: 100%;
}

.auth-popup__input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-popup__input-icon {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: #9ca3af;
    pointer-events: none;
}

.auth-popup__input {
    width: 100%;
    padding: 16px 56px 16px 46px;
    font-size: 16px;
    font-family: inherit;
    color: #1f2937;
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
}

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

.auth-popup__input:focus {
    border-color: #8b5cf6;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

/* Validační hláška */
.auth-popup__error {
    display: none;
    font-size: 13px;
    color: #ef4444;
    margin: 8px 0 0 0;
    padding-left: 4px;
}

.auth-popup__error--visible {
    display: block;
}

/* Input s chybou */
.auth-popup__input--error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.auth-popup__input--error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

/* Tlačítko odeslat (šipka) */
.auth-popup__submit {
    position: absolute;
    right: 6px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-popup__submit:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.auth-popup__submit:active {
    transform: scale(0.98);
}

.auth-popup__submit-icon {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

/* ========================================
   PRÁVNÍ TEXT
   ======================================== */

.auth-popup__legal {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin-top: 20px;
    line-height: 1.5;
}

.auth-popup__legal-link {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 500;
}

.auth-popup__legal-link:hover {
    text-decoration: underline;
}

/* ========================================
   VÝBĚR ROLE (Cesta C)
   ======================================== */

.auth-popup--role {
    max-width: 440px;
}

.auth-popup__roles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-popup__role {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px;
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.auth-popup__role:hover {
    border-color: currentColor;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Zájemce - fialová */
.auth-popup__role--buyer {
    color: #8b5cf6;
}

.auth-popup__role--buyer:hover {
    background-color: #faf5ff;
    border-color: #8b5cf6;
}

/* Chovatel - oranžová */
.auth-popup__role--breeder {
    color: #f97316;
}

.auth-popup__role--breeder:hover {
    background-color: #fff7ed;
    border-color: #f97316;
}

/* Animace dýchání - výraznější */
@keyframes breathe {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 4px 12px var(--icon-shadow);
    }
    25% {
        transform: scale(1.08) rotate(-2deg);
    }
    50% {
        transform: scale(1.12) rotate(0deg);
        box-shadow: 0 8px 24px var(--icon-shadow-strong);
    }
    75% {
        transform: scale(1.08) rotate(2deg);
    }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    20% { transform: rotate(-8deg) scale(1.1); }
    40% { transform: rotate(8deg) scale(1.15); }
    60% { transform: rotate(-5deg) scale(1.1); }
    80% { transform: rotate(5deg) scale(1.05); }
}

/* Ikona role */
.auth-popup__role-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    animation: breathe 2s ease-in-out infinite;
}

/* Zájemce - fialový gradient */
.auth-popup__role--buyer .auth-popup__role-icon {
    --icon-shadow: rgba(139, 92, 246, 0.35);
    --icon-shadow-strong: rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
}

/* Chovatel - oranžový gradient */
.auth-popup__role--breeder .auth-popup__role-icon {
    --icon-shadow: rgba(249, 115, 22, 0.35);
    --icon-shadow-strong: rgba(249, 115, 22, 0.5);
    background: linear-gradient(135deg, #fdba74 0%, #f97316 50%, #ea580c 100%);
    animation-delay: 0.5s;
}

.auth-popup__role-icon svg {
    width: 26px;
    height: 26px;
    color: #ffffff;
    fill: #ffffff;
    stroke: #ffffff;
    transition: transform 0.3s ease;
}

/* Hover efekty */
.auth-popup__role:hover .auth-popup__role-icon {
    animation: none;
    transform: scale(1.12);
    box-shadow: 0 8px 24px var(--icon-shadow-strong);
}

.auth-popup__role:hover .auth-popup__role-icon svg {
    animation: wiggle 0.4s ease-in-out;
}

/* Obsah role */
.auth-popup__role-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-popup__role-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.auth-popup__role-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

/* Šipka */
.auth-popup__role-arrow {
    width: 20px;
    height: 20px;
    color: #d1d5db;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.auth-popup__role:hover .auth-popup__role-arrow {
    color: currentColor;
    transform: translateX(4px);
}

/* ========================================
   RESPONZIVITA - TABLET (768px+)
   ======================================== */

@media (min-width: 768px) {
    .auth-overlay {
        padding: 24px;
    }

    .auth-popup {
        padding: 40px 36px;
        border-radius: 24px;
    }

    .auth-popup__close {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    .auth-popup__logo-image {
        height: 42px;
    }

    .auth-popup__title {
        font-size: 26px;
        margin-bottom: 28px;
    }

    .auth-popup__subtitle {
        font-size: 16px;
    }

    .auth-popup__social-btn {
        padding: 16px 24px;
        font-size: 16px;
    }

    .auth-popup__input {
        padding: 18px 60px 18px 50px;
        font-size: 16px;
    }

    .auth-popup__submit {
        width: 48px;
        height: 48px;
        right: 8px;
    }

    .auth-popup__success-icon {
        width: 72px;
        height: 72px;
    }

    .auth-popup__success-icon svg {
        width: 36px;
        height: 36px;
    }

    .auth-popup__role {
        padding: 20px;
    }

    .auth-popup__role-icon {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    .auth-popup__role-icon svg {
        width: 32px;
        height: 32px;
    }

    .auth-popup__role-title {
        font-size: 17px;
    }

    .auth-popup__role-desc {
        font-size: 14px;
    }
}

/* ========================================
   RESPONZIVITA - DESKTOP (1024px+)
   ======================================== */

@media (min-width: 1024px) {
    .auth-popup {
        max-width: 420px;
        padding: 44px 40px;
    }

    .auth-popup--role {
        max-width: 480px;
    }

    .auth-popup__title {
        font-size: 28px;
    }
}
