/* Policy wizard styles extracted from index.html for centralized asset management. */

.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: default;
}

.wizard-step .step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.wizard-step.active .step-number,
.wizard-step.completed .step-number {
    background: var(--primary);
    color: white;
}

.wizard-step.completed .step-number {
    background: #28a745;
}

.wizard-step .step-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
}

.wizard-step.active .step-label,
.wizard-step.completed .step-label {
    color: var(--primary);
}

.wizard-step.completed .step-label {
    color: #28a745;
}

.wizard-step-connector {
    flex: 1;
    max-width: 60px;
    height: 2px;
    background: #e9ecef;
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
}

.wizard-step.completed + .wizard-step-connector {
    background: #28a745;
}

.wizard-step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wizard-step-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.wizard-step-header h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
}

.wizard-step-header p {
    margin: 0;
}

.wizard-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.wizard-filter-group {
    flex: 0 0 200px;
    margin: 0;
}

.wizard-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.template-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.template-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.template-card.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.template-card.template-custom {
    border-style: dashed;
    background: #f8f9fa;
}

.template-card.template-custom:hover {
    background: #e9ecef;
}

.template-card.template-custom.selected {
    background: rgba(37, 99, 235, 0.1);
}

.template-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.template-custom .template-icon {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.template-content {
    flex: 1;
    min-width: 0;
}

.template-content h5 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9375rem;
    color: var(--text);
}

.template-content p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-check {
    color: var(--primary);
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-card.selected .template-check {
    opacity: 1;
}

.template-info-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 6px;
    color: var(--primary);
    margin-top: 1rem;
}

.editor-toolbar {
    padding: 0.5rem;
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.editor-toolbar .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.wizard-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.wizard-toolbar-divider {
    width: 1px;
    background: var(--border);
    margin: 0 0.25rem;
}

#wizardPolicyBody {
    border-radius: 0 0 4px 4px;
    font-family: monospace;
    font-size: 0.875rem;
}

.settings-section {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.settings-section h5 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 0.9375rem;
}

.review-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
}

.review-header h5 {
    margin: 0;
    font-size: 0.9375rem;
}

.review-content {
    padding: 1rem;
}

.review-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.review-item:last-child {
    margin-bottom: 0;
}

.review-label {
    color: var(--text-light);
    font-size: 0.875rem;
    min-width: 120px;
}

.review-value {
    color: var(--text);
    font-size: 0.875rem;
}

.review-body-preview {
    font-size: 0.875rem;
}

.review-body-preview h1,
.review-body-preview h2,
.review-body-preview h3 {
    margin-top: 0;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8125rem;
}

.attachment-item i {
    color: var(--text-light);
}

.attachment-item .remove-attachment {
    cursor: pointer;
    color: #dc3545;
    margin-left: 0.25rem;
}

.wizard-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    --wizard-overlay-padding: clamp(0.875rem, 2vw, 1.5rem);
    --wizard-surface-padding-inline: clamp(1rem, 2vw, 1.5rem);
    --wizard-surface-padding-block: clamp(1rem, 1.8vw, 1.25rem);
    padding: var(--wizard-overlay-padding);
    box-sizing: border-box;
}

.wizard-modal-overlay[style*="display: flex"],
.wizard-modal-overlay[style*="display:flex"] {
    display: flex !important;
}

.wizard-modal-overlay .modal-content {
    background: var(--card, white);
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: min(90vh, calc(100vh - (var(--wizard-overlay-padding) * 2)));
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.wizard-modal-overlay .modal-header {
    padding: var(--wizard-surface-padding-block) var(--wizard-surface-padding-inline);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    gap: 0.75rem;
}

.wizard-modal-overlay .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.wizard-modal-overlay .modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wizard-modal-overlay .modal-close:hover {
    background: var(--border);
}

.wizard-modal-overlay .modal-body {
    padding: var(--wizard-surface-padding-block) var(--wizard-surface-padding-inline);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-gutter: stable;
}

.wizard-modal-overlay .modal-footer {
    padding: 1rem var(--wizard-surface-padding-inline);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.wizard-nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.wizard-preview-body {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .wizard-progress {
        padding: 1rem;
    }

    .wizard-step .step-label {
        display: none;
    }

    .wizard-step-connector {
        max-width: 30px;
    }

    .templates-grid {
        grid-template-columns: 1fr;
    }

    .form-row,
    .wizard-two-col {
        grid-template-columns: 1fr !important;
    }

    .wizard-modal-overlay {
        --wizard-overlay-padding: 0.625rem;
        --wizard-surface-padding-inline: 0.95rem;
        --wizard-surface-padding-block: 0.95rem;
        padding: var(--wizard-overlay-padding);
    }

    .wizard-modal-overlay .modal-content {
        max-height: 95vh;
    }

    .wizard-filter-group {
        flex-basis: 100%;
    }

    .wizard-nav {
        width: 100%;
    }
}
