/* Demfati Forms - Modern Viewer */
:root {
    --primary-color: #048bff;
    --primary-hover: #034783;
    --accent-color: #f97316;
    --bg-color: #f8fafc;
    --bg-elevated: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --danger: #dc2626;
    --success: #16a34a;
    --font-body: 'Poppins';
    --font-display: 'Poppins';
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.16);
}

body {
    background-color: var(--bg-color);
    font-family: var(--font-body);
    color: var(--text-main);
    line-height: 1.65;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body.has-hero {
    background-image: var(--page-hero-image);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
}

/* Typography & Reset */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

* {
    box-sizing: border-box;
}

/* Layout */
.form-container {
    max-width: 720px;
    margin: 2.5rem auto;
    padding: 0 1.5rem 3rem;
}

.form-shell {
    position: relative;
}

.card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
    margin-bottom: 1.75rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
}

.card-body {
    padding: 2rem;
}

/* Header */
.form-header {
    text-align: left;
    margin-bottom: 2rem;
}

.form-title {
    font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem);
}

.form-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.form-header img {
    max-height: 80px;
    margin-bottom: 1rem;
}

.hero-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Inputs */
.form-group {
    margin-bottom: 0.5rem;
    padding: 2rem;
    position: relative;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-label.required::after {
    content: " *";
    color: var(--danger);
}

.form-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.preview-mode-banner p {
    margin-bottom: 0;
}

.preview-mode-meta {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.92rem;
    opacity: 0.9;
}

.form-divider {
    margin: 0.25rem 0 1.5rem;
    width: 100%;
}

.form-divider--line {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text-muted);
}

.form-divider__line {
    flex: 1 1 auto;
    height: 1px;
    background: rgba(148, 163, 184, 0.55);
}

.form-divider__line-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.form-divider--text {
    padding: 1.1rem 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(4, 139, 255, 0.14);
    background: rgba(4, 139, 255, 0.05);
}

.form-divider__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.form-divider__text,
.form-divider__caption {
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-divider--image {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.form-divider__image {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #fff;
}

.form-control {
    width: 100%;
    padding: 1.5rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #fff;
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Radio & Checkbox */
.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.option-item:hover {
    background-color: #f1f5f9;
}

.option-item input {
    margin-right: 0.75rem;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.6rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #f8fafc;
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 6px;
    background-color: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.4s ease;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.step-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
}

.step-title {
    font-size: 1.15rem;
    color: var(--text-main);
}

/* Animation */
.form-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-step.active {
    display: block;
}

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

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.statusMsg .alert {
    margin-bottom: 0;
}

#IUbUIsd {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 990;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(6px);
}

#IUbUIsd.csdu {
    display: flex;
    align-items: center;
    justify-content: center;
}

#IUbUIsf {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(15, 118, 110, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    min-height: 120px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--text-muted);
    transition: all 0.2s;
    background: #fafafa;
    padding: 1rem;
    text-align: center;
}

.file-upload-wrapper:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
    color: var(--primary-color);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.file-preview {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: #f1f5f9;
    color: var(--text-main);
}

.file-preview img {
    max-height: 90px;
    border-radius: 10px;
}

.file-preview .file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* Footer */
.form-footer {
    text-align: center;
    margin-top: 3rem;
    padding-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.report-modal-open {
    overflow: hidden;
}

.form-report-shell {
    width: min(720px, calc(100% - 2rem));
    margin: 0 auto 1.5rem;
    text-align: right;
}

.form-report-toggle {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: underline;
    padding: 0;
}

.form-report-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.form-report-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
}

.form-report-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(680px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.form-report-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.15rem;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.form-report-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-report-card__header strong {
    display: block;
    font-size: 1.12rem;
}

.form-report-card__hint {
    color: #64748b;
    margin: 0.4rem 0 0;
}

.form-report-close {
    border: 0;
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.15rem;
}

.form-report-close:hover {
    color: var(--text-main);
}

.form-report-message {
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.85rem;
    font-size: 0.95rem;
}

.form-report-message.is-success {
    background: #dcfce7;
    color: #166534;
}

.form-report-message.is-error {
    background: #fee2e2;
    color: #991b1b;
}

.form-footer a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

.helper-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-actions-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-end;
    margin-top: 2rem;
}

.form-actions-row .btn,
.btn-group.step-controls .btn {
    width: auto;
    flex: 1 1 160px;
    min-width: 140px;
}

@media (min-width: 768px) {
    .form-actions-row {
        flex-wrap: nowrap;
    }

    .form-actions-row .btn,
    .btn-group.step-controls .btn {
        flex: 0 1 auto;
    }
}

.p__rt {
    background-color: #fff;
    max-width: 320px;
    padding: 0.75rem 1rem;
    position: fixed;
    right: 16px;
    bottom: 16px;
    border-radius: 12px;
    display: none;
    text-align: left;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
    z-index: 999;
}

.p__rt button {
    display: block;
    margin: 0 0 0.5rem auto;
    background-color: transparent;
    font-size: 12px;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--text-muted);
}

.p__rt p {
    font-size: 0.9rem;
    text-align: left;
    margin: 0.25rem 0 0.75rem;
}

.p__rt .btn {
    width: 100%;
}

@media (max-width: 640px) {
    .form-container {
        padding: 1.5rem 1rem 3rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .form-report-shell {
        width: min(720px, calc(100% - 2rem));
        text-align: left;
    }

    .form-report-modal {
        padding: 0.75rem;
        align-items: flex-end;
    }

    .form-report-modal__dialog {
        width: 100%;
        max-height: calc(100vh - 1.5rem);
    }

    .form-report-card {
        border-radius: 18px 18px 14px 14px;
        padding: 1rem;
    }
}

.form-footer a:hover {
    text-decoration: underline;
}
