/* =========================================================
   Tap4Rate - Styles pages compte (connexion/inscription/dashboard)
   =========================================================
   Ce fichier est charge EN PLUS de style.css (voir includes/header.php) :
   il ne redefinit que ce qui est specifique aux pages de connexion,
   d'inscription et au tableau de bord (formulaires, cartes NFC listees...).
   ========================================================= */

.auth-body {
    background: var(--bg-alt, #f6f6fc);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 50px 20px;
    font-family: 'Inter', system-ui, sans-serif;
}

.auth-wrapper {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.auth-logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: #17162a;
}
.auth-logo span {
    background: linear-gradient(90deg, #5b3df5, #00d4b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-card, .dashboard {
    width: 100%;
    background: #fff;
    border: 1px solid #e9e8f5;
    border-radius: 22px;
    padding: 40px;
    box-shadow: 0 20px 45px -25px rgba(23, 22, 42, 0.25);
}
.auth-card--wide { max-width: 640px; }

.auth-card h1, .dashboard h1 { font-family: 'Poppins', sans-serif; margin-bottom: 4px; }
.auth-subtitle { color: #5c5c74; margin-bottom: 24px; }

fieldset {
    border: none;
    padding: 0;
    margin: 0 0 20px;
}
fieldset legend {
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    padding: 0;
    margin-bottom: 12px;
    color: #17162a;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 14px 0 6px;
    color: #17162a;
}
input[type="email"],
input[type="password"],
input[type="text"],
input[type="url"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dcdaf0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select { background: #fff; cursor: pointer; }
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #5b3df5;
    box-shadow: 0 0 0 3px rgba(91, 61, 245, 0.15);
}
small { color: #7d7c94; display: block; margin-top: 4px; font-size: 0.8rem; }

/* Bloc d'aide repliable (ex: "Je ne sais pas comment trouver ce lien") */
.help-block {
    margin-top: 8px;
    background: #f6f6fc;
    border: 1px solid #e9e8f5;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
}
.help-block summary {
    cursor: pointer;
    font-weight: 600;
    color: #5b3df5;
    list-style: none;
}
.help-block summary::-webkit-details-marker { display: none; }
.help-block p { margin: 10px 0 6px; color: #17162a; }
.help-block ol { margin: 0 0 10px; padding-left: 20px; color: #17162a; }
.help-block li { margin-bottom: 6px; }
.help-block code {
    background: #eeecfb;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.8rem;
    word-break: break-all;
}
.help-block a { color: #5b3df5; font-weight: 600; }

form .g-recaptcha { margin: 20px 0; }

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    font-size: 0.85rem;
    font-weight: 400;
    color: #5c5c74;
    cursor: pointer;
}
.checkbox-field input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #5b3df5;
}
.checkbox-field a { color: #5b3df5; font-weight: 600; }

.auth-switch { text-align: center; margin-top: 20px; color: #5c5c74; }
.auth-switch a { color: #5b3df5; font-weight: 600; }

.auth-footer-link { margin-top: 4px; }
.auth-footer-link a { color: #5c5c74; font-size: 0.9rem; }

.flash {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}
.flash--error { background: #fff0f1; color: #b3223b; border: 1px solid #ffd2d8; }
.flash--success { background: #eafaf3; color: #0f7a52; border: 1px solid #bdeed6; }
.flash ul { margin: 0; padding-left: 18px; }

/* ----- Dashboard ----- */
.dashboard { max-width: 900px; }
.dashboard__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 30px;
}
.dashboard__cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.tag-card {
    border: 1px solid #e9e8f5;
    border-radius: 16px;
    padding: 22px;
    background: #fbfbff;
}
.tag-card header { display: flex; flex-direction: column; margin-bottom: 12px; }
.tag-card h2 { font-size: 1.05rem; margin-bottom: 4px; }
.tag-card__id {
    font-size: 0.75rem;
    color: #7d7c94;
    background: #eeecfb;
    padding: 3px 10px;
    border-radius: 999px;
    width: fit-content;
}
.tag-card__form label { margin-top: 10px; font-size: 0.82rem; }
.tag-card__actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.tag-card__delete { margin-top: 10px; text-align: right; }
.tag-card__link {
    margin-top: 14px;
    font-size: 0.78rem;
    word-break: break-all;
    color: #7d7c94;
}
.tag-card__link code { background: #eeecfb; padding: 2px 6px; border-radius: 6px; }
.tag-card--new { border-style: dashed; }

@media (max-width: 640px) {
    .auth-card, .dashboard { padding: 26px; }
    .dashboard__top { flex-direction: column; align-items: flex-start; }
    /* En dessous de 640px, une seule colonne garantie (evite tout risque de
       debordement horizontal si un ecran est plus etroit que 240px+marges). */
    .dashboard__cards { grid-template-columns: 1fr; }
}
