/* ============================================
   MarryThem — Prototype Stylesheet
   Aesthetic: Warm, refined, matrimonial
   ============================================ */

:root {
    /* Palette chaude & élégante */
    --rose:        #c45b3e;
    --rose-light:  #e8a090;
    --rose-pale:   #fdf0ec;
    --gold:        #b8943e;
    --gold-light:  #f5e6c3;
    --cream:       #faf7f2;
    --cream-dark:  #f0ebe3;
    --charcoal:    #2d2a26;
    --slate:       #6b6560;
    --mist:        #a39e98;
    --white:       #ffffff;
    --green:       #4a9e6d;
    --green-light: #e8f5ee;
    --red:         #d44;
    --red-light:   #fde8e8;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'DM Sans', -apple-system, sans-serif;

    /* Dimensions du smartphone */
    --phone-width:  390px;
    --phone-height: 844px;
    --phone-radius: 48px;
    --notch-width:  150px;
    --nav-height:   72px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--charcoal);
    color: var(--charcoal);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* === Fond décoratif === */
.backdrop {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #2d2a26 0%, #4a3f35 40%, #3d2e28 100%);
    z-index: 0;
}
.backdrop-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    opacity: 0.5;
}
.backdrop-info {
    position: fixed;
    top: 50%;
    left: calc(50% - var(--phone-width)/2 - 180px);
    transform: translate(-50%, -50%);
    text-align: right;
    color: var(--rose-light);
    z-index: 1;
}
.logo-large {
    font-size: 64px;
    margin-bottom: 12px;
}
.backdrop-info h1 {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 700;
    color: var(--cream);
    letter-spacing: -0.5px;
}
.backdrop-info p {
    font-size: 14px;
    color: var(--mist);
    margin-top: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* === Cadre smartphone === */
.phone-frame {
    position: relative;
    width: var(--phone-width);
    height: var(--phone-height);
    background: var(--charcoal);
    border-radius: var(--phone-radius);
    padding: 12px;
    box-shadow:
        0 0 0 2px #555,
        0 30px 80px rgba(0,0,0,0.6),
        inset 0 0 0 1px rgba(255,255,255,0.05);
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.phone-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: var(--notch-width);
    height: 32px;
    background: var(--charcoal);
    border-radius: 0 0 20px 20px;
    z-index: 20;
}
.phone-notch::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #444;
}

/* === Écran === */
.phone-screen {
    flex: 1;
    background: var(--cream);
    border-radius: 36px 36px 0 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
}
.phone-screen::-webkit-scrollbar { width: 0; }

#screen-container {
    min-height: 100%;
    padding-top: 44px;
    padding-bottom: 16px;
}

/* === Barre de navigation === */
.phone-nav {
    height: var(--nav-height);
    background: var(--white);
    border-radius: 0 0 36px 36px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    border-top: 1px solid var(--cream-dark);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mist);
    transition: color 0.2s ease;
    padding: 6px 10px;
    border-radius: 12px;
    font-family: var(--font-body);
}
.nav-btn span {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
}
.nav-btn:hover { color: var(--slate); }
.nav-btn.active {
    color: var(--rose);
}
.nav-btn.active svg { stroke-width: 2.5; }

/* === Écrans génériques === */
.screen {
    padding: 0 20px;
    animation: screenFadeIn 0.3s ease;
}

@keyframes screenFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.screen-header {
    text-align: center;
    padding: 20px 0 16px;
}
.screen-header h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--charcoal);
    letter-spacing: -0.3px;
}
.screen-header p {
    font-size: 13px;
    color: var(--slate);
    margin-top: 4px;
    line-height: 1.4;
}

/* === Boutons === */
.btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    letter-spacing: 0.2px;
}
.btn-primary {
    background: var(--rose);
    color: var(--white);
}
.btn-primary:hover { background: #b34f35; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--cream-dark);
    color: var(--charcoal);
}
.btn-secondary:hover { background: #e5dfd7; }

.btn-outline {
    background: transparent;
    color: var(--rose);
    border: 1.5px solid var(--rose);
}
.btn-outline:hover { background: var(--rose-pale); }

.btn-gold {
    background: var(--gold);
    color: var(--white);
}

.btn-sm {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 10px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn + .btn { margin-top: 10px; }

/* === Formulaires === */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--cream-dark);
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--charcoal);
    background: var(--white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(196,91,62,0.1);
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}
.form-group .hint {
    font-size: 11px;
    color: var(--mist);
    margin-top: 4px;
}

/* Range slider */
.range-group {
    display: flex;
    align-items: center;
    gap: 12px;
}
.range-group input[type="range"] {
    flex: 1;
    border: none;
    padding: 0;
    accent-color: var(--rose);
    height: 6px;
}
.range-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--rose);
    min-width: 36px;
    text-align: center;
}

/* Select buttons (choix multiples visuels) */
.select-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.select-btn {
    padding: 8px 16px;
    border: 1.5px solid var(--cream-dark);
    border-radius: 20px;
    background: var(--white);
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--slate);
    cursor: pointer;
    transition: all 0.2s ease;
}
.select-btn:hover { border-color: var(--rose-light); }
.select-btn.selected {
    background: var(--rose-pale);
    border-color: var(--rose);
    color: var(--rose);
    font-weight: 600;
}

/* === Cards === */
.card {
    background: var(--white);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
}

.card-couple {
    text-align: center;
    padding: 24px 16px;
}
.couple-photos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.couple-photo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--cream-dark);
}
.couple-heart {
    font-size: 28px;
    color: var(--rose);
    animation: heartBeat 1.5s ease infinite;
}
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* === Vote === */
.vote-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}
.vote-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.vote-btn:active { transform: scale(0.9); }
.vote-btn.vote-yes {
    background: var(--green);
    color: white;
}
.vote-btn.vote-yes:hover { background: #3d8a5e; transform: scale(1.05); }
.vote-btn.vote-no {
    background: var(--white);
    color: var(--red);
    border: 2px solid var(--cream-dark);
}
.vote-btn.vote-no:hover { background: var(--red-light); transform: scale(1.05); }
.vote-btn.vote-skip {
    background: var(--cream-dark);
    color: var(--slate);
    width: 48px;
    height: 48px;
    font-size: 18px;
}

/* === Match card === */
.match-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--white);
    border-radius: 16px;
    margin-bottom: 10px;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.2s ease;
}
.match-card:hover { transform: translateX(4px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.match-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--rose-pale);
}
.match-info { flex: 1; }
.match-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--charcoal);
}
.match-meta {
    font-size: 12px;
    color: var(--mist);
    margin-top: 2px;
}
.match-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}
.badge-new { background: var(--rose-pale); color: var(--rose); }
.badge-active { background: var(--green-light); color: var(--green); }
.badge-waiting { background: var(--gold-light); color: var(--gold); }

/* === Messages === */
.message-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 6px;
    animation: msgIn 0.25s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.msg-sent {
    background: var(--rose);
    color: var(--white);
    margin-left: auto;
    border-bottom-right-radius: 6px;
}
.msg-received {
    background: var(--white);
    color: var(--charcoal);
    border: 1px solid var(--cream-dark);
    border-bottom-left-radius: 6px;
}
.msg-time {
    font-size: 10px;
    color: var(--mist);
    margin-bottom: 12px;
}
.msg-time.sent { text-align: right; }

.chat-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 0 0;
    border-top: 1px solid var(--cream-dark);
    margin-top: 12px;
}
.chat-input-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--cream-dark);
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
}
.chat-input-bar input:focus { border-color: var(--rose); }
.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--rose);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.chat-send-btn:hover { background: #b34f35; }

/* === Écran d'accueil (non connecté) === */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(var(--phone-height) - 130px);
    padding: 40px 24px;
    text-align: center;
}
.welcome-logo { font-size: 56px; margin-bottom: 16px; }
.welcome-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--charcoal);
    letter-spacing: -0.5px;
}
.welcome-subtitle {
    font-size: 14px;
    color: var(--slate);
    margin: 8px 0 32px;
    line-height: 1.5;
    max-width: 280px;
}
.welcome-actions { width: 100%; max-width: 280px; }

/* === Score / Progress === */
.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--cream-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--rose);
    margin: 0 auto 8px;
}
.score-label {
    font-size: 12px;
    color: var(--mist);
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--cream-dark);
    border-radius: 3px;
    overflow: hidden;
    margin: 12px 0;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rose), var(--gold));
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* === Stepper (inscription) === */
.stepper {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}
.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cream-dark);
    transition: all 0.3s ease;
}
.step-dot.active {
    background: var(--rose);
    width: 24px;
    border-radius: 4px;
}
.step-dot.done { background: var(--green); }

/* === Toast notification === */
.toast {
    position: absolute;
    top: 52px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 10px 20px;
    background: var(--charcoal);
    color: var(--white);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    z-index: 30;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--mist);
}
.empty-state .emoji { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--slate);
    margin-bottom: 6px;
}
.empty-state p { font-size: 13px; line-height: 1.5; }

/* === Divers === */
.divider {
    height: 1px;
    background: var(--cream-dark);
    margin: 16px 0;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--cream-dark);
    color: var(--slate);
}

.text-rose { color: var(--rose); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-muted { color: var(--mist); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* === Responsive (si ouvert sur mobile réel) === */
@media (max-width: 420px) {
    body {
        display: block;
        overflow: hidden;
    }
    .phone-frame {
        width: 100vw;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        position: fixed;
        top: 0;
        left: 0;
        display: flex;
        flex-direction: column;
    }
    .phone-notch { display: none; }
    .phone-screen {
        border-radius: 0;
        flex: 1 1 0%;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .phone-nav {
        border-radius: 0;
        flex: 0 0 auto;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .backdrop { display: none; }
    #screen-container { padding-top: 16px; padding-bottom: 16px; }
}
