/* /static/css/global.css */
body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #fff;
    color: #333;
}

body.embedded-view {
    margin: 0;
}

body.embedded-view .header-logo-container,
body.embedded-view footer {
    display: none;
}

body.modal-is-open .wizard-container,
body.modal-active .wizard-container {
    filter: blur(4px);
    pointer-events: none;
}

.wizard-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 0px rgba(0, 0, 0, 0.15);
    max-width: 1115px;
    margin: 20px auto;
    transition: filter 0.3s ease-in-out;
}

body.embedded-view .wizard-container {
    margin-top: 0;
}

.header-logo-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-logo-container img {
    max-width: 300px;
    height: auto;
    margin-bottom: 10px;
}

.header-logo-container h2 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 2em;
    border-bottom: none;
}

.step {
    display: none;
    animation: fadeIn 0.5s;
}
.step.active { display: block; }
.ipa-form .step { display: block; } /* IPA form shows all content at once */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.step > h2 {
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 1.75em;
    border-bottom-width: 2px;
    border-bottom-style: solid;
}

h3 {
    color: #333;
    margin-top: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

label {
    display: block;
    margin-top: 12px;
    font-weight: bold;
    font-size: 0.95em;
    color: #555;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select, textarea {
    width: calc(100% - 24px);
    padding: 10px;
    margin-top: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}

input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 5px rgba(15, 71, 122, 0.25);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
}

.form-group { flex: 1; min-width: 280px; }
.form-group-full { flex-basis: 100%; }

.navigation-buttons {
    margin-top: 30px;
    text-align: right;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

button {
    padding: 12px 25px;
    margin-left: 10px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

button:disabled { background-color: #cccccc; cursor: not-allowed; }

button.add-btn {
    background-color: #28a745;
    margin-top: 15px;
    margin-bottom: 10px;
    padding: 10px 18px;
    font-size: 0.9em;
}
button.add-btn:hover { background-color: #1e7e34; }

button.remove-btn {
    background-color: #dc3545;
    padding: 6px 12px;
    font-size: 0.8em;
    margin-left: 10px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
button.remove-btn:hover { background-color: #c82333; }

.dynamic-item {
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-top: 15px;
    border-radius: 5px;
    background-color: #fdfdfd;
    position: relative;
}

.dynamic-item h4 {
    margin-top: 0;
    font-size: 1.1em;
    padding-bottom: 5px;
    border-bottom: 1px dotted #ccc;
}
.dynamic-item .remove-btn { position: absolute; top: 15px; right: 15px; }

.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: .25rem;
    margin-bottom: 25px;
    height: 24px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: .25rem;
    text-align: center;
    color: white;
    line-height: 24px;
    font-weight: bold;
    transition: width .4s ease;
}

fieldset {
    padding: 20px;
    margin-top: 20px;
    border-radius: 5px;
    background-color: #fafdff;
    border-width: 1px;
    border-style: solid;
}

legend {
    font-weight: bold;
    padding: 0 10px;
    font-size: 1.2em;
}

p.section-description { font-size: 0.9em; color: #666; margin-bottom: 15px; }
input[type="checkbox"] + label { font-weight: normal; display: inline-block; margin-left: 5px; margin-top: 0; }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
body.embedded-view .modal-overlay { background-color: transparent; padding-top: 0; padding-bottom: 40px; }

.modal-content {
    background-color: #fff; padding: 25px 30px; border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2); width: 90%; max-width: 750px;
    text-align: left; transform: translateY(-20px); transition: transform 0.3s ease;
}
body.embedded-view .modal-content {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); border: 1px solid #e9ecef;
    max-width: 750px; padding-bottom: 35px;
}

.modal-title {
    margin-top: 0; margin-bottom: 15px; border-bottom: 1px solid #eee;
    padding-bottom: 10px; font-size: 1.5em;
}

.modal-body p, .modal-body li { line-height: 1.6; color: #333; }
.modal-body ul { list-style-type: disc; padding-left: 20px; }
.modal-body li { margin-bottom: 10px; }
.modal-actions { margin-top: 25px; text-align: right; }

.modal-actions button {
    padding: 10px 20px; border: none; border-radius: 5px;
    cursor: pointer; font-size: 1em; margin-left: 10px;
}
.modal-actions .modal-btn-secondary { background-color: #e9ecef; color: #333; }
.modal-actions .modal-btn-secondary:hover { background-color: #d1d5d9; }

.modal-input {
    width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px;
    box-sizing: border-box; margin-top: 5px;
}

.step-navigation {
    display: flex; justify-content: center; flex-wrap: wrap;
    gap: 8px; margin-bottom: 25px;
}

.step-navigation-button {
    background-color: #f1f1f1; border: 1px solid #ddd; border-radius: 6px;
    width: 36px; height: 36px; display: flex; align-items: center;
    justify-content: center; cursor: pointer; font-weight: bold;
    color: #555; transition: all 0.2s ease; position: relative;
}
.step-navigation-button:hover { background-color: #e0e0e0; border-color: #ccc; }

.custom-tooltip {
    position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
    background-color: #333; color: #fff; padding: 6px 10px;
    border-radius: 4px; font-size: 0.85em; white-space: nowrap;
    opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
}
.step-navigation-button:hover .custom-tooltip { opacity: 1; visibility: visible; }

.grecaptcha-badge { visibility: hidden !important; }

/* IPA Specific Styles */
.radio-group-options { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.radio-group-options label {
    flex: 1; min-width: 80px; text-align: center; background-color: #f8f9fa;
    padding: 12px; border: 1px solid #dee2e6; border-radius: 5px;
    cursor: pointer; transition: all 0.2s ease-in-out; margin-top: 0;
}
.radio-group-options input[type="radio"] { display: none; }
.details-textarea { display: none; margin-top: 15px; background-color: #ffffff; }
.permission-text {
    font-size: 0.9em; color: #444; margin-top: 15px; padding: 15px;
    background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 4px;
}

/* --- Mobile Responsive Styles --- */
@media (max-width: 768px) {
    .modal-content, body.embedded-view .modal-content { margin-left: 20px; margin-right: 20px; }
    .header-logo-container { flex-direction: column; align-items: center; gap: 15px; }
    .navigation-buttons { display: flex; flex-direction: column; gap: 12px; }
    .navigation-buttons button { width: 100%; margin: 0 !important; float: none; }
    #nextBtn { order: 1; }
    #prevBtn { order: 2; }
    #pdfBtn, #submitFactFinderBtn, #submitBtn { order: 3; }
    button[onclick="saveProgress()"], #clearProgressBtn, #startOverBtn { order: 4; }
    .modal-overlay { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 80px 0; }
    .modal-content { transform: none !important; }
    .modal-actions { display: flex; flex-direction: column-reverse; gap: 12px; }
    .modal-actions button { width: 100%; margin: 0; }
}