@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Frontin Sans', 'Montserrat', sans-serif; background: #eef1f4; color: #333; font-size: 11px; }

.hidden { display: none !important; }

/* ===== LOGIN ===== */
.login-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 360px;
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.login-card h2 { color: #004358; font-size: 16px; margin-bottom: 8px; }
.login-card .file-note { color: #777; font-size: 11px; margin-bottom: 16px; }
.login-card .field { margin-bottom: 14px; }
.login-card label { display: block; font-size: 11px; font-weight: 600; margin-bottom: 4px; color: #333; }
.login-card input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #D9D9D9;
  border-radius: 4px;
  font-size: 13px;
}
.error-msg { color: #dc2626; font-size: 11px; margin-bottom: 10px; }

/* ===== LAYOUT ===== */
.app { display: flex; min-height: 100vh; }

/* ===== PANNEAU GAUCHE ===== */
.panel {
    width: 290px;
    flex-shrink: 0;
    background: #004358;
    color: #fff;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.back-link {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    text-decoration: none;
}
.back-link:hover { color: #fff; }
.panel-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #FFDD59;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.panel-section {
    font-size: 8.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,221,89,0.7);
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.status-tag { font-size: 9px; color: rgba(255,255,255,0.5); text-transform: none; letter-spacing: 0; }
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label {
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.6);
}
.field-group input, .field-group select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-family: 'Frontin Sans', 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 500;
    outline: none;
    transition: border 0.2s;
}
.field-group input:focus, .field-group select:focus {
    border-color: #FFDD59;
    background: rgba(255,255,255,0.12);
}
.field-group input::placeholder { color: rgba(255,255,255,0.3); }
.field-group select option { background: #004358; color: #fff; }

.taux-block {
    background: rgba(255,221,89,0.1);
    border: 1px solid rgba(255,221,89,0.3);
    border-radius: 4px;
    padding: 11px 12px;
    display: none;
    flex-direction: column;
    gap: 8px;
}
.taux-block.visible { display: flex; }
.taux-block label {
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,221,89,0.85);
}
.taux-block input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(255,221,89,0.4);
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-family: 'Frontin Sans', 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    outline: none;
}
.taux-block input:focus { border-color: #FFDD59; }
.taux-result {
    font-size: 10px;
    color: #FFDD59;
    font-weight: 600;
    text-align: center;
    padding: 6px 0 2px;
    min-height: 18px;
}

.btn-reset {
    padding: 9px;
    background: transparent;
    color: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    font-family: 'Frontin Sans', 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-reset:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.4); }

.btn-print {
    padding: 11px;
    background: #FFDD59;
    color: #004358;
    border: none;
    border-radius: 4px;
    font-family: 'Frontin Sans', 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}
.btn-print:hover { background: #f5d000; }
.panel .btn-print { margin-top: auto; }

/* ===== APERCU ===== */
.preview-zone {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 24px;
    overflow-y: auto;
}

/* ===== DOCUMENT A4 ===== */
.document {
    width: 794px;
    min-height: 1123px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    padding: 40px 44px 28px;
    display: flex;
    flex-direction: column;
}
.doc-content { flex: 1; }

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #FFDD59;
    padding-bottom: 14px;
    margin-bottom: 28px;
}
.logo-container { width: 90px; }
.logo-container img { max-width: 100%; height: auto; display: block; }
.doc-meta { text-align: right; color: #004358; }
.doc-meta h1 { font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.doc-meta p { font-size: 10.5px; color: #555; font-weight: 500; }

.section-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #004358;
    margin-bottom: 10px;
    margin-top: 22px;
    padding-bottom: 5px;
    border-bottom: 1px solid #D9D9D9;
}

.info-table { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.info-table td { padding: 6px 4px; font-size: 11px; vertical-align: top; }
.info-table td:first-child { color: #666; width: 38%; font-weight: 500; }
.info-table td:last-child { font-weight: 600; color: #222; }

.row-taux { display: none; }
.row-taux.visible { display: table-row; }

.amount-block {
    border: 1px solid #004358;
    border-left: 4px solid #004358;
    border-radius: 3px;
    padding: 18px 22px;
    margin: 22px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fbfc;
}
.amount-block .label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: #666; margin-bottom: 4px; }
.amount-block .value { font-size: 26px; font-weight: 700; color: #004358; letter-spacing: -0.5px; }
.amount-block .equiv { font-size: 10px; color: #888; margin-top: 4px; font-style: italic; }
.amount-block .words { font-size: 10.5px; color: #555; font-style: italic; text-align: right; max-width: 280px; }

.declaration {
    border: 1px solid #D9D9D9;
    border-radius: 3px;
    padding: 18px 20px;
    margin: 22px 0;
    font-size: 11px;
    line-height: 1.9;
    color: #333;
    text-align: justify;
}

.signature-area { display: flex; justify-content: flex-end; margin-top: 32px; }
.sign-block { width: 44%; }
.sign-block .sign-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #004358; margin-bottom: 2px; }
.sign-block .sign-name { font-size: 11px; color: #444; font-weight: 500; margin-bottom: 12px; }
.sign-line {
    border: 1px dashed #aaa;
    border-radius: 3px;
    min-height: 130px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    font-size: 9px;
    color: #bbb;
    font-style: italic;
}

.doc-footer {
    border-top: 1px solid #D9D9D9;
    padding-top: 9px;
    margin-top: 28px;
    display: flex;
    justify-content: space-between;
    font-size: 8.5px;
    color: #999;
}

/* ===== PRINT ===== */
@media print {
    @page { size: A4; margin: 12mm 14mm; }
    html, body { background: #fff; }
    .panel { display: none; }
    .preview-zone { padding: 0; display: block; }
    .document { width: 100%; min-height: 100vh; box-shadow: none; padding: 0; }
    .app { display: block; }
}
