:root {
    --eucalyptus: #A3B2A1;
    --creamsicle: #FBDB9A;
    --summer-cream: #F6E3B3;
    --minted-mist: #C8D3C3;
    --btn-color: #DCA34E;
}

body {
    margin: 0; padding: 0;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    background: radial-gradient(circle at top left, var(--summer-cream), var(--creamsicle), var(--minted-mist));
    display: flex; justify-content: center; align-items: center;
}

.container { width: 100%; max-width: 500px; padding: 20px; text-align: center; box-sizing: border-box; }

header { margin-bottom: 12px; display: flex; gap: 10px; }
header input {
    width: 100%; background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid var(--eucalyptus);
    padding: 8px; border-radius: 10px; font-family: 'Outfit', sans-serif;
}

.id-card {
    background: #fff; border-radius: 12px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
    padding: 12px 22px; text-align: left;
    position: relative; overflow: hidden;
    display: flex; flex-direction: column;
    height: 255px;
}

.card-filigree {
    position: absolute; top: 75px; right: 20px;
    width: 90px !important; opacity: 0.08; pointer-events: none; z-index: 1;
}

.card-seal { 
    position: absolute; bottom: 8px; right: 8px; 
    width: 130px; opacity: 0.12; z-index: 1; 
}

.card-header {
    border-bottom: 0.8px solid #002654;
    margin-bottom: 8px; padding-bottom: 4px;
    display: flex; justify-content: space-between;
}

.republique { font-size: 7.5px; letter-spacing: 2.5px; font-weight: bold; color: #002654; }
.card-title { font-family: 'Quicksand', sans-serif; font-size: 13px; color: var(--eucalyptus); font-weight: 700; }
.icon-flag { height: 16px; }

.card-content { display: flex; gap: 18px; flex-grow: 1; z-index: 2; position: relative; }

.photo-zone { width: 100px; height: 120px; background: #f5f8f9; border-radius: 5px; overflow: hidden; flex-shrink: 0; }
.photo-zone img { width: 100%; height: 100%; object-fit: cover; }

.info-zone { flex: 1; font-size: 10px; display: flex; flex-direction: column; justify-content: space-between; padding: 0; }

/* Nouvelle ligne Nom / Sexe */
.field-row { display: flex; justify-content: space-between; align-items: flex-end; }
.text-right { text-align: right; }

.field { display: flex; flex-direction: column; margin-bottom: 0px; }
.label { font-weight: bold; color: #aaa; font-size: 7px; margin-bottom: -2px; }
.value { color: #333; font-weight: 700; font-size: 13.5px; font-family: 'Quicksand', sans-serif; }

.info-zone input {
    border: none;
    font-family: 'Quicksand', sans-serif; font-size: 14px; font-weight: 700;
    color: #333; outline: none; background: transparent; padding: 0;
    height: 20px; line-height: 20px;
}

.dotted-short { border-bottom: 1.5px dashed var(--creamsicle) !important; width: 65% !important; }
.dotted-long { border-bottom: none; width: 98%; }

.date-row { display: flex; align-items: baseline; gap: 3px; }
#in_date { width: 48px !important; }
.year-fixed { font-family: 'Quicksand', sans-serif; font-size: 14px; font-weight: 700; color: #333; }
.at-text { font-family: 'Outfit', sans-serif; font-size: 12px; color: #aaa; font-weight: 400; }
.time-input { width: 50px !important; }

.card-footer { 
    margin-top: auto; padding-top: 15px;
    font-family: monospace; font-size: 11px; 
    color: #bbb; letter-spacing: 1.8px; 
}

.btn-submit {
    margin-top: 15px; background: var(--btn-color);
    color: white; border: none; padding: 12px 40px;
    border-radius: 50px; font-weight: bold; cursor: pointer;
}

/* Popins */
.success-overlay, .welcome-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(10px);
    display: flex; justify-content: center; align-items: center; z-index: 100;
}

.success-card, .welcome-card {
    background: white; padding: 30px; border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12); width: 85%; max-width: 400px;
}

.welcome-card h3 { color: var(--eucalyptus); margin-top: 0; margin-bottom: 15px; }
.welcome-card p { font-size: 15px; color: #666; line-height: 1.5; margin-bottom: 20px; }

.btn-download { background: var(--eucalyptus); color: white; border: none; padding: 12px; border-radius: 10px; cursor: pointer; font-weight: bold; width: 100%; margin-bottom: 8px; }
.btn-retry { background: transparent; border: 1px solid #eee; color: #aaa; padding: 8px; border-radius: 10px; cursor: pointer; width: 100%; font-size: 11px; }

.popin-registry { margin-top: 20px; padding-top: 15px; border-top: 1px solid #f0f0f0; }
.popin-registry span { display: block; font-size: 13px; color: #666; margin-bottom: 10px; }
.popin-registry a { 
    background: var(--eucalyptus); color: white; padding: 8px 20px; 
    border-radius: 50px; font-weight: 700; text-decoration: none; 
    font-size: 12px; display: inline-block;
    box-shadow: 0 4px 10px rgba(163, 178, 161, 0.2);
}

.registry { margin-top: 25px; font-size: 14px; }
.registry span { color: #666; display: block; margin-bottom: 10px; }
.registry a { 
    background: var(--eucalyptus); 
    color: white; padding: 10px 25px; 
    border-radius: 50px; font-weight: 700; 
    text-decoration: none; box-shadow: 0 4px 12px rgba(163, 178, 161, 0.3);
    display: inline-block;
}

/* Mobile */
@media (max-width: 500px) {
    .container { padding: 15px; }
    header { flex-direction: column; gap: 8px; }
    .id-card { padding: 10px 15px; height: 240px; }
    .photo-zone { width: 85px; height: 105px; }
    .card-content { gap: 12px; }
    .card-title { font-size: 11px; }
    .republique { font-size: 6px; letter-spacing: 1.5px; }
    .label { font-size: 6.5px; }
    .value { font-size: 11.5px; }
    .info-zone input { font-size: 12.5px; height: 18px; }
    .card-footer { font-size: 8px; letter-spacing: 1px; }
    .welcome-card, .success-card { padding: 20px; }
    .welcome-card h3 { font-size: 18px; }
}