@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600&display=swap');

:root {
    --bg-0: #f7f5f2;
    --bg-1: #e8f0f7;
    --ink-0: #0f172a;
    --ink-1: #334155;
    --muted: #64748b;
    --accent: #0f766e;
    --accent-2: #f97316;
    --card: #ffffff;
    --line: #e2e8f0;
    --shadow: 0 18px 36px rgba(15, 23, 42, 0.10);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Grotesk", system-ui, sans-serif;
    color: var(--ink-0);
    background:
        radial-gradient(1200px 600px at 15% -10%, #fff4e6 0%, transparent 65%),
        radial-gradient(900px 500px at 90% 0%, #e0f2fe 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
    min-height: 100vh;
}

.page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 56px 16px 80px;
}

.card-form {
    width: 100%;
    max-width: 1040px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
    background: var(--card);
    animation: cardRise 0.6s ease both;
}

.card-header-clean {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--line);
    padding: 24px 26px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-logo {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #fff;
}

.title-wrap {
    line-height: 1.1;
}

.title-wrap h1 {
    font-family: "Fraunces", serif;
    font-size: 26px;
    margin: 0;
    font-weight: 600;
    color: var(--ink-0);
}

.title-wrap p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.title-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.title-kicker::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent-2);
}

.step-pill {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: #ecfeff;
    color: #155e75;
    font-weight: 600;
    font-size: 12px;
}

.autocomplete-results {
    position: absolute;
    width: 100%;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-top: 4px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.autocomplete-item {
    padding: 12px 14px;
    cursor: pointer;
    font-size: 14px;
}

.autocomplete-item:hover {
    background: #f1f5f9;
}

/* Styles pour le bouton "Suivant" */
.btn-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-soft);
}

.btn-next:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

.progress-thin {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
}

.progress-thin .progress-bar {
    background: linear-gradient(90deg, #0f766e, #f97316);
    border-radius: 999px;
}

.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid var(--line);
    padding: 10px 12px;
    font-weight: 500;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, 0.4);
    box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.25);
}

.section-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--ink-0);
}

.stepper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 14px 0 22px;
}

.stepper-item {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stepper-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 12px;
}

.stepper-item.is-active {
    color: var(--ink-0);
    border-color: rgba(15, 118, 110, 0.4);
    background: #ecfeff;
}

.stepper-item.is-active span {
    background: var(--accent);
    color: #fff;
}

.field-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 6px;
}

.is-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.15);
}

.preview-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.preview-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}

.preview-item strong {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 6px;
}

.ok-alert {
    border-radius: 12px;
    background: #ecfeff;
    color: #0f766e;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

@keyframes cardRise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .card-header-clean {
        flex-direction: column;
        align-items: flex-start;
    }

    .title-wrap h1 {
        font-size: 22px;
    }
}

/* ===== Comments SMS-style System ===== */
.comments-container {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--line);
}

.comments-header {
    font-size: 18px;
    font-weight: 600;
    font-family: "Fraunces", serif;
    margin-bottom: 20px;
    color: var(--ink-0);
}

.comments-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.comment-bubble {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

.comment-bubble.own {
    justify-content: flex-end;
}

.comment-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
}

.comment-bubble:not(.own) .comment-content {
    background: linear-gradient(135deg, var(--accent) 0%, #118b7e 100%);
    color: white;
    border-bottom-left-radius: 4px;
}

.comment-bubble.own .comment-content {
    background: var(--accent-2);
    color: white;
    border-bottom-right-radius: 4px;
}

.comment-author {
    font-weight: 600;
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.comment-time {
    font-size: 11px;
    opacity: 0.75;
    margin-top: 6px;
    display: block;
}

/* Comment Form */
.comment-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.comment-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--line);
    border-radius: 24px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    transition: all 0.2s ease;
}

.comment-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.comment-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent) 0%, #118b7e 100%);
    color: white;
    border: none;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.comment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.25);
}

.comment-btn:active {
    transform: translateY(0);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Modal Cards ===== */
.modal-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
}

.info-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    border-color: var(--accent);
}

.card-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: inline-block;
}

.card-title {
    font-family: "Fraunces", serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-0);
    margin: 0 0 8px 0;
}

.card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin: 12px 0 0 0;
}

.card-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--card);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    animation: modalSlideIn 0.3s ease both;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--line);
}

.modal-title {
    font-family: "Fraunces", serif;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: var(--ink-0);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--ink-0);
    transform: rotate(90deg);
}

.modal-body {
    margin-bottom: 24px;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-label {
    font-weight: 600;
    color: var(--ink-1);
    margin-bottom: 6px;
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-field-value {
    font-size: 16px;
    color: var(--ink-0);
    padding: 12px;
    background: var(--bg-0);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    border: none;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #118b7e 100%);
    color: white;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 118, 110, 0.3);
}

.modal-btn-secondary {
    background: var(--bg-0);
    color: var(--ink-0);
    border: 1px solid var(--line);
}

.modal-btn-secondary:hover {
    background: var(--line);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
