/* ============================================
   NOSDDPP - Přihlašovací Modal
   ============================================ */

/* Modal overlay */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.auth-modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Modal content */
.auth-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 1rem;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close button */
.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.auth-modal-close:hover {
    background: #e2e8f0;
    color: #334155;
}

/* Form sections */
.auth-form {
    display: none;
    padding: 2rem;
}

.auth-form.active {
    display: block;
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(145deg, #f5f5f5 0%, #c9c9c9 20%, #e0e0e0 40%, #b0b0b0 60%, #d0d0d0 80%, #c0c0c0 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
}

.auth-icon svg {
    width: 32px;
    height: 32px;
    stroke: #475569;
    fill: none;
    stroke-width: 2;
}

.auth-icon.green {
    background: linear-gradient(145deg, #4ade80 0%, #22c55e 30%, #16a34a 70%, #15803d 100%);
}

.auth-icon.green svg {
    stroke: #fff;
}

.auth-icon.yellow {
    background: linear-gradient(145deg, #fde047 0%, #eab308 30%, #ca8a04 70%, #a16207 100%);
}

.auth-icon.yellow svg {
    stroke: #fff;
}

.auth-header h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #64748b;
    font-size: 0.9375rem;
}

/* Form inner */
.auth-form-inner .form-group {
    margin-bottom: 0.75rem;
}

.auth-form-inner .form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #475569;
    font-size: 0.8125rem;
}

.auth-form-inner .form-group input,
.auth-form-inner .form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #fff;
}

.auth-form-inner .form-group input:focus,
.auth-form-inner .form-group select:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.auth-form-inner .form-group input::placeholder {
    color: #94a3b8;
}

.auth-form-inner .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Checkbox in modal */
.auth-form-inner .form-checkbox {
    margin: 0.75rem 0;
}

.auth-form-inner .form-group.form-checkbox .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 400;
    margin-bottom: 0;
}

.auth-form-inner .form-group.form-checkbox .checkbox-label input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    border: 2px solid var(--color-gray-400);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
    padding: 0;
    margin: 0;
    transition: all 0.2s ease;
}

.auth-form-inner .form-group.form-checkbox .checkbox-label input[type="checkbox"]:checked {
    background: #22c55e;
    border-color: #22c55e;
}

.auth-form-inner .form-group.form-checkbox .checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-form-inner .form-group.form-checkbox .checkbox-label a {
    color: #dc2626;
}

/* Buttons */
.btn-full {
    width: 100%;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    margin-top: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Error and success messages */
.auth-error,
.auth-success {
    display: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-error {
    background: linear-gradient(to right, #fee2e2, #fef2f2);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.auth-success {
    background: linear-gradient(to right, #dcfce7, #f0fdf4);
    color: #166534;
    border: 1px solid #86efac;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.875rem;
}

.auth-link {
    color: #dc2626;
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-divider {
    margin: 0 0.5rem;
    color: #cbd5e1;
}

/* User menu in nav */
.nav-cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-cta.ready {
    opacity: 1;
}

.btn-icon {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.btn-logout-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    background: var(--color-gray-200);
    color: var(--color-gray-600);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    font-family: var(--font-body);
    font-weight: 500;
}

.btn-logout-small:hover {
    background: var(--color-gray-300);
    color: var(--color-gray-800);
}

/* Member login prompt in contact form */
.member-login-prompt {
    background: linear-gradient(to right, #f0fdf4, #dcfce7);
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.member-login-prompt p {
    color: #166534;
    margin-bottom: 1rem;
    font-weight: 500;
}

.member-login-prompt .btn {
    min-width: 200px;
}

/* Responsive - tablet */
@media (max-width: 600px) {
    .auth-modal-content {
        max-width: 95vw;
        margin: 0.75rem;
    }

    .auth-form {
        padding: 1.5rem;
    }

    .auth-header h3 {
        font-size: 1.25rem;
    }

    .auth-header p {
        font-size: 0.875rem;
    }

    .auth-icon {
        width: 52px;
        height: 52px;
    }

    .auth-icon svg {
        width: 26px;
        height: 26px;
    }
}

/* Responsive - mobile */
@media (max-width: 480px) {
    .auth-modal-content {
        margin: 0.5rem;
        max-height: 95vh;
        border-radius: 12px;
    }

    .auth-form {
        padding: 1.25rem;
    }

    .auth-header {
        margin-bottom: 1rem;
    }

    .auth-header h3 {
        font-size: 1.125rem;
    }

    .auth-form-inner .form-group label {
        font-size: 0.75rem;
    }

    .auth-form-inner .form-group input,
    .auth-form-inner .form-group select {
        padding: 0.4rem 0.625rem;
        font-size: 0.8125rem;
    }

    .auth-form-inner .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-form-inner .form-group.form-checkbox .checkbox-label input[type="checkbox"] {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
        padding: 0;
        margin: 0;
    }

    .auth-form-inner .form-group.form-checkbox .checkbox-label input[type="checkbox"]:checked::after {
        left: 6px;
        top: 2px;
        width: 6px;
        height: 11px;
    }

    .auth-form-inner .form-group.form-checkbox .checkbox-label {
        font-size: 0.75rem;
    }

    .btn-full {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .auth-footer {
        font-size: 0.8125rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .user-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
}
