/* Custom Color Scheme & Properties */
:root {
    --bs-primary: #0d6efd; /* Bootstrap Blue for main actions */
    --bs-primary-rgb: 13, 110, 253;
    --accent-color: #f9a602; /* Vibrant orange/gold for highlights */
    --bs-body-font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-bg: #dbeaf3;
    --progress-width: 0%;
}

body {
    font-family: var(--bs-body-font-family), sans-serif;
    background-color: var(--bs-body-bg);
    transition: background-color 0.2s ease-in-out;
}

.card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* --- Themed Background Styles --- */
.card-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.card-background-image.visible {
    opacity: 1;
}

.card-body {
    position: relative;
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.3);
}

/* Custom Progress Bar */
#progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    position: relative;
}

#progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 4px;
    width: 100%;
    background: #e9ecef;
    z-index: 1;
}

#progress-bar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 4px;
    width: var(--progress-width, 0%);
    background: var(--accent-color);
    z-index: 2;
    transition: width 0.4s ease-in-out;
}

.step-indicator {
    width: 35px;
    height: 35px;
    background: var(--bs-body-bg);
    color: #6c757d;
    border: 3px solid #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 3;
    transition: all 0.4s ease-in-out;
}

.step-indicator.active {
    border-color: var(--accent-color);
    background-color: var(--accent-color);
    color: white;
}

/* Form Steps Animation */
.form-step {
    display: none;
    animation: fadeIn 0.5s;
}

.form-step.active {
    display: block;
}

.content-container {
    background-color: rgba(255, 255, 255, 0.75);
    padding: .5rem;
    border-radius: 0.375rem;
}

.step-header {
    /* Spacing handled by utility classes */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Project Selection Buttons - General Layout */
.project-item {
    padding: 1rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Make sure invalid feedback for hidden project input is visible */
.invalid-feedback {
    display: none;
}

input.is-invalid ~ .invalid-feedback,
select.is-invalid ~ .invalid-feedback,
.was-validated input:invalid ~ .invalid-feedback,
.was-validated select:invalid ~ .invalid-feedback {
    display: block;
}

#project-error-message.is-invalid {
    display: block;
    background-color: rgba(28, 110, 124, 0.2);
    color: #206984;
    font-weight: 500;
    padding: 1rem;
    border-radius: 0.375rem;
}

/* Styles for the dynamic location display element */
#location-display {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 1.2rem;
}

#location-display.loading {
    color: #6c757d;
}

#location-display.success {
    color: #198754;
}

#location-display.error {
    color: #dc3545;
}

/* Email Validation Styles */
.validation-message {
    width: 100%;
    margin-top: 0.5rem;
    font-size: .875em;
    padding: 0;
    text-align: left;
    font-weight: bold;
}

.validation-success {
    color: #0f5132;
}

.validation-error {
    color: #842029;
}

.validation-warning {
    color: #664d03;
}

.bounce-message {
    display: block;
    margin-top: 0.25rem;
    font-style: italic;
    color: #6c757d;
}

input.validating {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230d6efd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 3c-1.333 0-2.5.5-3.5 1.5S3 6.667 3 8m2 0c0-1.105.895-2 2-2'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: 1.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}


/* --- Glossy Button Styles --- */

/* Base styles for ALL glossy buttons (primary, secondary, and project) */
.btn-primary,
.btn-secondary,
.project-item.btn-outline-primary {
    border-radius: 12px;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.5);
    transition: all 0.15s ease-in-out;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

/* Shine effect for all glossy buttons */
.btn-primary::before,
.btn-secondary::before,
.project-item.btn-outline-primary::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 60%);
    transform: scale(0);
    transition: transform 0.5s ease;
}

/* Universal hover and active states for lifting/pressing */
.btn-primary:hover,
.btn-secondary:hover,
.project-item.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.project-item.btn-outline-primary:hover::before {
    transform: scale(1);
}

.btn-primary:active,
.btn-secondary:active,
.project-item.btn-outline-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
    filter: brightness(0.9);
}

/* --- Specific Color and Text Styles --- */

/* Primary Button (Blue - used for Next/Submit and SELECTED project) */
.btn-primary {
    background: linear-gradient(to bottom, #4d94ff, #0d6efd);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
    filter: brightness(1.1);
}

/* Secondary Button (Gray - used for Back) */
.btn-secondary {
    background: linear-gradient(to bottom, #9ca3af, #6c757d);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-secondary:hover {
    filter: brightness(1.1);
}

/* Project Buttons (UNSELECTED State) */
.project-item.btn-outline-primary {
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    color: #495057;
    text-shadow: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.project-item.btn-outline-primary:hover {
    color: #212529;
    filter: brightness(1.05);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

.project-item.btn-outline-primary:active {
    filter: brightness(0.98);
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* This is the class Bootstrap uses by default, so we override it to prevent conflicts. */
.btn-outline-primary {
    background-color: transparent;
}

/* --- Button-Specific Fixes --- */

/* FIX: Prevent the "Back" button text from wrapping on small screens. */
#prevBtn {
    white-space: nowrap;
}