/* MietDoc Base Styles */

body {
    font-family: 'Amiri', serif;
    /* High-contrast white wash over the background image */
    background: linear-gradient(rgba(255, 255, 255, 0.90), rgba(255, 255, 255, 0.90)), url('/images/Background.webp') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-strong);
    margin: 0;
    padding-top: 68px;
}

/* Disclaimer Banner Styling */
.disclaimer-banner {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-left: 5px solid #ffc107;
    padding: var(--space-4) var(--space-6);
    margin: var(--space-8) auto;
    border-radius: var(--radius-md);
    max-width: 800px;
    text-align: center;
    font-size: 0.95rem;
    box-shadow: var(--shadow-xs);
}

a { color: var(--brand-primary); }
a:hover { color: var(--color-heavy-purple); }

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(90deg, var(--color-ice-cold), var(--color-medium-purple));
    box-shadow: var(--shadow-sm);
    z-index: 1020;
}

.app-header .navbar-brand {
    font-weight: 700;
    color: var(--text-strong);
}

.app-header .nav-link {
    color: var(--text-strong);
    font-weight: 600;
    padding: var(--space-2) var(--space-3);
    transition: color var(--duration-fast) var(--ease-default);
}

.app-header .nav-link:hover,
.app-header .nav-link:focus {
    color: var(--brand-primary);
}

main {
    min-height: 70vh;
}

.app-footer {
    background: var(--neutral-900);
    border-top: 3px solid var(--brand-primary);
    color: var(--neutral-300);
    padding: var(--space-12) 0 var(--space-8);
    margin-top: var(--space-16);
}

.app-footer h5,
.app-footer h6 {
    color: white;
}

.app-footer a {
    color: var(--brand-primary-light);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-default);
}

.app-footer a:hover {
    color: white;
    text-decoration: underline;
}

.app-footer hr {
    border-color: var(--neutral-700);
    opacity: 0.5;
}

.app-footer .btn-outline-primary {
    color: var(--brand-primary-light);
    border-color: var(--neutral-600);
}

.app-footer .btn-outline-primary:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    transition: all var(--duration-fast) var(--ease-default);
}

.btn-primary:hover {
    background-color: var(--color-heavy-purple);
    border-color: var(--color-heavy-purple);
}

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    transition: all var(--duration-fast) var(--ease-default);
}

.btn-outline-primary:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

/* Bootstrap btn-check (radio/toggle buttons) */
.btn-check:checked + .btn-outline-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.btn-check:focus + .btn-outline-primary {
    box-shadow: 0 0 0 0.25rem rgba(132, 88, 179, 0.25);
}

/* Override ALL Bootstrap color variants to use scheme */
.btn-success, .btn-info {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}
.btn-success:hover, .btn-info:hover {
    background-color: var(--color-heavy-purple);
    border-color: var(--color-heavy-purple);
}

.btn-outline-success, .btn-outline-info {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}
.btn-outline-success:hover, .btn-outline-info:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.btn-secondary {
    background-color: var(--color-heavy-purple);
    border-color: var(--color-heavy-purple);
}
.btn-secondary:hover {
    background-color: var(--text-muted);
    border-color: var(--text-muted);
}

.btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-accent);
}
.btn-outline-secondary:hover {
    background-color: var(--brand-primary-bg);
    border-color: var(--border-accent);
    color: var(--text-strong);
}

/* Text color utilities */
.text-primary { color: var(--brand-primary) !important; }
.text-success, .text-info { color: var(--brand-primary) !important; }
.text-secondary { color: var(--text-muted) !important; }

/* Background color utilities */
.bg-primary { background-color: var(--brand-primary) !important; }
.bg-success, .bg-info { background-color: var(--brand-primary) !important; }

/* Link color */
.link-primary { color: var(--brand-primary) !important; }
.link-primary:hover { color: var(--color-heavy-purple) !important; }

.card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.disclaimer-banner {
    background: linear-gradient(135deg, rgba(255, 243, 224, 0.8), rgba(255, 235, 205, 0.9));
    border-left: 5px solid #ff9800;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
}

.disclaimer-banner strong {
    color: #e65100;
}

/* Material Icons & Symbols */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* Skip to main content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: var(--space-2);
    background: var(--brand-primary);
    color: white;
    padding: var(--space-2);
    text-decoration: none;
    z-index: 1100;
    border-radius: var(--radius-sm);
}

.skip-link:focus {
    top: var(--space-2);
}

/* Smooth default transitions for interactive elements */
a {
    transition: color var(--duration-fast) var(--ease-default);
}

.btn {
    transition: all var(--duration-fast) var(--ease-default);
}

.card {
    transition: box-shadow var(--duration-normal) var(--ease-default),
                transform var(--duration-normal) var(--ease-default);
}

.form-control,
.form-select {
    transition: border-color var(--duration-fast) var(--ease-default),
                box-shadow var(--duration-fast) var(--ease-default);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .app-header, .app-footer, .no-print {
        display: none !important;
    }
    body {
        padding-top: 0;
    }
}

/* Clean Horizontal Wizard Steps */
.wizard-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: var(--space-4) var(--space-6);
    margin: 0 0 var(--space-6) 0;
    gap: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Card header styling - use brand color */
.card-header.bg-primary {
    background-color: var(--color-heavy-purple) !important;
    border-bottom: none;
}

.wizard-steps li {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    white-space: nowrap;
}

.wizard-steps li .step-label {
    font-size: 1.1rem;
}

.wizard-steps li .step-num {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--brand-primary-bg);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: var(--space-2);
    transition: transform var(--duration-fast) var(--ease-back);
}

.wizard-steps li.active .step-num {
    background: var(--brand-primary);
    color: white;
}

.wizard-steps li.completed .step-num {
    background: var(--brand-primary);
    color: white;
}

.wizard-steps li.active {
    color: var(--text-strong);
    font-weight: 600;
}

.wizard-steps li.completed {
    color: var(--brand-primary);
}

/* Arrow separator */
.wizard-steps li:not(:last-child)::after {
    content: '\203A';
    margin: 0 var(--space-4);
    color: var(--border-accent);
    font-size: 1.2rem;
    font-weight: 300;
}

.wizard-steps li.completed:not(:last-child)::after,
.wizard-steps li.active:not(:last-child)::after {
    color: var(--brand-primary);
}

/* Wizard progress bar */
.wizard-steps {
    position: relative;
}

.wizard-steps::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: var(--wizard-progress, 20%);
    background: linear-gradient(90deg, var(--brand-primary), var(--color-purple-pain));
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    transition: width var(--duration-slow) var(--ease-default);
}

/* Mobile: vertical stepper layout with full labels */
@media (max-width: 576px) {
    .wizard-steps {
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-3) var(--space-4);
        gap: 0;
    }
    .wizard-steps li {
        position: relative;
        padding-left: 44px;
        min-height: 40px;
        display: flex;
        align-items: center;
        font-size: 0.95rem;
    }
    .wizard-steps li .step-num {
        position: absolute;
        left: 0;
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
        margin-right: 0;
        z-index: 1;
    }
    .wizard-steps li .step-label {
        font-size: 0.95rem;
        max-width: none;
        overflow: visible;
        text-overflow: clip;
    }
    /* Vertical connector line instead of arrow */
    .wizard-steps li:not(:last-child)::after {
        content: '';
        position: absolute;
        left: 14px;
        top: 34px;
        width: 2px;
        height: calc(100% - 24px);
        background: var(--border-default);
        margin: 0;
        font-size: 0;
        min-height: 8px;
    }
    .wizard-steps li.completed:not(:last-child)::after,
    .wizard-steps li.active:not(:last-child)::after {
        background: var(--brand-primary);
    }
    /* Progress bar on bottom still works */
    .wizard-steps::after {
        height: 2px;
    }
}

/* Tablet: compact horizontal with shorter labels */
@media (min-width: 577px) and (max-width: 768px) {
    .wizard-steps li .step-label {
        font-size: 0.8rem;
    }
    .wizard-steps li .step-num {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        margin-right: var(--space-1);
    }
    .wizard-steps li:not(:last-child)::after {
        margin: 0 var(--space-2);
        font-size: 1rem;
    }
    .wizard-steps {
        padding: var(--space-3) var(--space-3);
    }
}

/* Step link hover effect */
.wizard-steps .step-link {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.wizard-steps .step-link:hover .step-num {
    transform: scale(1.1);
}
.wizard-steps .step-link:hover .step-label {
    text-decoration: underline;
}

/* Wizard button styling with icon alignment */
.btn-wizard {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-weight: 600;
    font-size: 1rem;
    padding: var(--space-2) var(--space-5);
    transition: all var(--duration-fast) var(--ease-default);
}
.btn-wizard .material-symbols-outlined {
    font-size: 1.25rem;
    line-height: 1;
}

/* General button icon alignment */
.btn .material-symbols-outlined {
    vertical-align: middle;
}

/* Enhanced Form Validation Visual Cues */
.form-control:invalid:not(:placeholder-shown),
.form-control.is-invalid,
.form-control.validation-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-control:valid:not(:placeholder-shown):not(.is-invalid) {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

/* Animated shake for invalid fields on submit */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.validation-shake {
    animation: shake 0.5s var(--ease-default);
}

/* Highlight required fields that are empty */
.form-control[required]:invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Error message styling */
.field-error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.field-error-message .material-symbols-outlined {
    font-size: 1rem;
}

/* Person/representative block with error */
.person-block.has-error,
.representative-block.has-error {
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.05);
}

/* Form submit button disabled state when invalid */
.btn-wizard:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Required field indicator */
.text-danger {
    color: #dc3545 !important;
}

/* Label for invalid field */
.form-label.is-invalid {
    color: #dc3545;
}
