/* ============================================================
   modals.css — Generic modal, change password modal
   ============================================================ */

/* ── Generic modal ───────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-default);
}

.modal-header h2 {
    margin-bottom: 0.5rem;
}

.modal-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-section {
    margin: 1.5rem 0;
}

.modal-section h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* ── Lausunto copy button ─────────────────────────────────── */
.lausunto-subheader {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.lausunto-subheader h4 {
    margin: 0;
}

.copy-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.copy-icon-btn:hover {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.copy-icon-btn.copied {
    color: #16a34a;
    border-color: #16a34a;
}

.document-modal-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* ── Change Password modal ───────────────────────────────── */
.change-password-modal {
    max-width: 500px;
    padding: 2.5rem;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.change-password-form {
    margin-top: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-default);
    border-radius: 12px;
    background: var(--card-bg);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border: 2px solid transparent;
    background: var(--card-bg),
                linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.15);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3), 0 4px 8px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-default);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--gradient-start);
    background: var(--hover-bg);
    transform: translateY(-1px);
}

.form-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Password requirements block */
.password-requirements {
    background: #f6f6f6;
    border-left: 4px solid #222;
    color: #222;
    padding: 10px 12px;
    margin: 8px 0 12px 0;
    border-radius: 4px;
    font-size: 0.95rem;
}

.password-requirements .requirements-title {
    margin: 0 0 6px 0;
    font-weight: 600;
}

.password-requirements ul {
    margin: 0;
    padding-left: 18px;
}

.password-requirements li {
    margin: 4px 0;
    color: #333;
    line-height: 1.3;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .document-modal-content {
        padding: 1rem;
    }

    .change-password-modal {
        padding: 1.5rem;
        margin: 10% auto;
        width: 95%;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
