/* Réinitialisation et variables */
:root {
    --bg-app: #f2f2f7;
    --bg-card: #ffffff;
    --text-main: #1c1c1e;
    --text-sec: #8e8e93;
    --accent: #007aff;
    --danger: #ff3b30;
    --success: #34c759;
    --border: #e5e5ea;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #000; /* Fond noir si vu sur PC */
    display: flex;
    justify-content: center;
    color: var(--text-main);
}

/* Conteneur contraint au format Mobile (pas de design PC) */
.mobile-app {
    width: 100%;
    max-width: 430px; /* Taille max d'un grand smartphone */
    background-color: var(--bg-app);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

header {
    background: var(--bg-card);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

header p {
    font-size: 0.9rem;
    color: var(--text-sec);
}

main {
    padding: 16px;
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.input-group {
    margin-bottom: 16px;
}

.row {
    display: flex;
    gap: 12px;
}

.row .input-group {
    flex: 1;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sec);
    margin-bottom: 8px;
}

/* Inputs optimisés pour le toucher mobile */
input, select {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px; /* 16px empêche le zoom auto sur iOS */
    background: #fafafa;
    color: var(--text-main);
    font-family: inherit;
    appearance: none;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
}

/* Barre d'action fixe en bas */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    z-index: 20;
}

.btn-primary {
    width: 100%;
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:active {
    opacity: 0.8;
}

/* Section Résultats */
.main-result {
    background: linear-gradient(135deg, #007aff, #0056b3);
    color: white;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.main-result h3 {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.9;
}

.big-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 8px 0;
}

.badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-box {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-sec);
    text-transform: uppercase;
    font-weight: 600;
}

.stat-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 4px 0;
}

.stat-sub {
    font-size: 0.8rem;
    color: var(--text-sec);
}

/* Utilitaires couleurs */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }