/* ============================================================
   Royal Technologies - Formulaire Devis Multi-étapes
   ============================================================ */

:root {
    --primary: #ce6c45;
    --primary-dark: #b35a36;
    --primary-light: #f4e3da;
    --secondary: #1e2a3a;
    --gradient-primary: linear-gradient(135deg, #ce6c45 0%, #b35a36 100%);
    --gradient-secondary: linear-gradient(135deg, #1e2a3a 0%, #2d3e54 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
}

/* ============ HERO ============ */
.devis-hero {
    position: relative;
    padding: 140px 0 80px;
    background: var(--gradient-secondary);
    color: #fff;
    overflow: hidden;
    text-align: center;
}
.devis-hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(206,108,69,0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(74,144,226,0.2) 0%, transparent 50%);
}
.devis-hero-content {
    position: relative;
    z-index: 1;
}
.devis-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 14px;
}
.devis-hero h1 .gradient-text {
    background: linear-gradient(135deg, #ce6c45 0%, #ffa500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.devis-hero p.lead {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    max-width: 600px;
    margin: 0 auto;
}

/* ============ SECTION FORM ============ */
.devis-section {
    padding: 60px 0 100px;
    background: #fafbfc;
    min-height: 50vh;
}
.devis-container {
    max-width: 900px;
    margin: -60px auto 0;
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

/* ============ PROGRESS BAR ============ */
.progress-wrapper {
    padding: 30px 40px 0;
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.progress-step-text {
    font-size: 13px;
    color: var(--secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.progress-percent {
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.progress-bar {
    width: 100%;
    height: 10px;
    background: #f0f0f0;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
}
.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 50px;
    transition: width 0.6s cubic-bezier(.2,.7,.4,1);
    position: relative;
    width: 25%;
}
.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.5) 50%,
        transparent 100%);
    animation: shine 2s infinite;
}
@keyframes shine {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* ============ STEP INDICATORS ============ */
.step-indicators {
    display: flex;
    justify-content: space-between;
    padding: 30px 40px;
    position: relative;
    border-bottom: 1px solid #eef1f5;
}
.step-indicators::before {
    content: '';
    position: absolute;
    top: 56px;
    left: 80px;
    right: 80px;
    height: 2px;
    background: #f0f0f0;
    z-index: 0;
}
.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    flex: 1;
    cursor: default;
}
.step-num {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e1e5eb;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}
.step-indicator.active .step-num {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(206,108,69,0.4);
}
.step-indicator.done .step-num {
    background: #28a745;
    color: #fff;
    border-color: transparent;
}
.step-indicator.done .step-num::before {
    content: '\f00c';
    font-family: 'FontAwesome';
}
.step-indicator.done .step-num-text { display: none; }

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    transition: color 0.3s;
}
.step-indicator.active .step-label { color: var(--primary); }
.step-indicator.done .step-label { color: #28a745; }

/* ============ FORM STEPS ============ */
.form-content {
    padding: 40px 50px;
}
.form-step {
    display: none;
    animation: stepFadeIn 0.5s ease;
}
.form-step.active { display: block; }
@keyframes stepFadeIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

.step-header {
    margin-bottom: 30px;
}
.step-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 8px;
}
.step-header p {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

/* ============ FORM FIELDS ============ */
.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}
.form-row-grid.cols-1 { grid-template-columns: 1fr; }
@media (max-width: 700px) { .form-row-grid { grid-template-columns: 1fr; } }

.form-field {
    display: flex;
    flex-direction: column;
}
.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary);
    font-size: 13.5px;
}
.form-field label .required { color: var(--primary); }
.form-field .help {
    color: #999;
    font-size: 12px;
    margin-top: 6px;
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="number"],
.form-field input[type="url"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 10px;
    font-size: 14.5px;
    font-family: inherit;
    transition: all 0.2s;
    background: #fff;
    color: var(--secondary);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(206,108,69,0.1);
}
.form-field input.error,
.form-field select.error,
.form-field textarea.error {
    border-color: #dc3545;
    background: #fff5f5;
}
.form-field textarea { resize: vertical; min-height: 110px; }

/* Radio cards (sélections visuelles) */
.radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 12px;
    margin-top: 4px;
}
.radio-cards label {
    cursor: pointer;
    display: block;
    background: #fafbfc;
    border: 2px solid #e1e5eb;
    border-radius: 12px;
    padding: 16px 14px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    user-select: none;
    margin: 0;
}
.radio-cards label:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.radio-cards label i {
    display: block;
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 8px;
}
.radio-cards label .radio-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    margin: 0;
}
.radio-cards label .radio-card-desc {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}
.radio-cards input[type="radio"] {
    position: absolute;
    opacity: 0;
}
.radio-cards input[type="radio"]:checked + .radio-card-content {
    /* styles when checked */
}
.radio-cards label.checked {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(206,108,69,0.2);
}
.radio-cards label.checked::after {
    content: '\f00c';
    font-family: 'FontAwesome';
    position: absolute;
    top: 8px; right: 8px;
    width: 22px; height: 22px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

/* ============ NAVIGATION BUTTONS ============ */
.form-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 50px 35px;
    background: #fafbfc;
    border-top: 1px solid #eef1f5;
    gap: 12px;
}
.form-nav .btn {
    padding: 14px 26px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-prev {
    background: #fff;
    border: 2px solid #e1e5eb !important;
    color: var(--secondary);
}
.btn-prev:hover:not(:disabled) {
    border-color: var(--secondary) !important;
    background: #f5f7fa;
}
.btn-prev:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.btn-next {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(206,108,69,0.3);
}
.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(206,108,69,0.4);
}
.btn-submit {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(40,167,69,0.3);
    font-size: 15px;
    padding: 16px 32px;
}
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(40,167,69,0.4);
}

/* ============ RECAP / REVIEW ============ */
.recap-card {
    background: #fafbfc;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 14px;
    border: 1px solid #eef1f5;
}
.recap-card h4 {
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.recap-card h4 .edit-link {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    text-decoration: underline;
}
.recap-line {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 16px;
    padding: 6px 0;
    font-size: 13.5px;
}
.recap-line .label { color: #777; }
.recap-line .value { color: var(--secondary); font-weight: 500; }
.recap-line .value.empty { color: #ccc; font-style: italic; }

/* ============ SUCCESS / ERROR ============ */
.field-error-msg {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}
.form-field.has-error .field-error-msg { display: block; }

/* ============ HELP TEXT ============ */
.section-info {
    background: #f4e3da;
    border-left: 4px solid var(--primary);
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 22px;
    color: #5c3a26;
    font-size: 13.5px;
}
.section-info i {
    color: var(--primary);
    margin-right: 6px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .progress-wrapper { padding: 20px 20px 0; }
    .step-indicators { padding: 20px 12px; }
    .step-indicators::before { left: 50px; right: 50px; top: 44px; }
    .step-num { width: 36px; height: 36px; font-size: 13px; }
    .step-label { font-size: 10px; }
    .form-content { padding: 24px 22px; }
    .form-nav { padding: 18px 22px 28px; }
    .form-nav .btn { padding: 12px 18px; font-size: 13px; }
    .recap-line { grid-template-columns: 1fr; gap: 2px; }
    .recap-line .label { font-size: 11px; }
}
