* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    color: #fff;
    line-height: 1.6;
    min-height: 100%;
    background: #1a1a1a;
}

/* Photo en fond, plein écran et fixe */
.bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: #1a1a1a;
}

.bg-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.05) brightness(0.9) saturate(0.9);
    transition: opacity 0.5s;
}

.bg-photo.loading {
    opacity: 0;
}

/* Voile sombre pour que le texte reste lisible par-dessus la photo */
.scrim {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.35) 40%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 50px 28px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

header {
    margin-bottom: 36px;
}

h1 {
    font-size: 2.4rem;
    font-weight: 300;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.form-group {
    margin-bottom: 26px;
}

label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input,
select {
    width: 100%;
    padding: 11px 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    font-size: 1.05rem;
    font-family: inherit;
    background: transparent;
    color: #fff;
    -webkit-appearance: none;
    border-radius: 0;
}

select option {
    color: #222;
}

input:focus,
select:focus {
    outline: none;
    border-bottom-color: #fff;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn {
    width: 100%;
    padding: 15px 0;
    margin-top: 10px;
    background: #fff;
    color: #1a1a1a;
    border: none;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: opacity 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.85;
}

/* Réponse — bien visible */
.response {
    margin-top: 28px;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    animation: pop 0.35s ease-out;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.response.hidden {
    display: none;
}

#responseContent {
    font-size: 1.05rem;
    line-height: 1.6;
    font-weight: 500;
}

#responseContent .detail {
    display: inline-block;
    margin: 6px 0;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.85;
}

.defi-label {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.7;
    margin-bottom: 2px;
}

/* Modal "changer le défi" */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.25s ease-out;
}

.modal.hidden {
    display: none;
}

.modal-card {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
}

.modal-card h2 {
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 10px;
}

.modal-card p {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-bottom: 16px;
}

.modal-card textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    border-radius: 4px;
    resize: vertical;
}

.modal-card textarea:focus {
    outline: none;
    border-color: #fff;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.modal-actions .btn {
    margin-top: 0;
}

.btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.response.success {
    background: rgba(76, 175, 80, 0.25);
    border-color: rgba(129, 199, 132, 0.6);
}

.response.warning {
    background: rgba(255, 152, 0, 0.25);
    border-color: rgba(255, 183, 77, 0.6);
}

@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
