/* ============ RepetiGAME - page de connexion ============ */
[ng-cloak], .ng-cloak { display: none !important; }

:root {
    --primary-purple: #6B46C1;
    --dark-purple: #553C9A;
    --light-purple: #8B5CF6;
    --orange: #F97316;
    --white: #FFFFFF;
    --grey: #6B7280;
    --light-grey: #F3F4F6;
    --dark-grey: #374151;
    --success-green: #10B981;
    --error-red: #EF4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: var(--dark-grey);
    background: linear-gradient(135deg, var(--dark-purple) 0%, var(--primary-purple) 50%, var(--light-purple) 100%);
    overflow-x: hidden;
}

/* ---------- décor flottant ---------- */
.bg-shapes { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.shape {
    position: absolute; font-weight: 800; color: rgba(255,255,255,.12);
    font-size: 5rem; animation: flotte 9s ease-in-out infinite;
}
.s1 { top: 8%;  left: 6%; }
.s2 { top: 70%; left: 10%; animation-delay: -2s; font-size: 6rem; }
.s3 { top: 15%; left: 45%; animation-delay: -4s; }
.s4 { top: 80%; left: 55%; animation-delay: -1s; color: rgba(249,115,22,.25); }
.s5 { top: 10%; right: 8%; animation-delay: -3s; color: rgba(249,115,22,.3); }
.s6 { top: 60%; right: 5%; animation-delay: -5s; }
@keyframes flotte {
    0%, 100% { transform: translateY(0) rotate(0); }
    50%      { transform: translateY(-18px) rotate(8deg); }
}

/* ---------- mise en page ---------- */
.login-page {
    position: relative; z-index: 1;
    min-height: 100vh;
    max-width: 1100px; margin: 0 auto;
    padding: 40px 24px;
    display: grid; grid-template-columns: 1fr 440px; gap: 48px; align-items: center;
}

.login-hero { color: var(--white); }
.login-logo {
    background: var(--white); border-radius: 14px; padding: 10px 16px;
    width: 260px; max-width: 100%; margin-bottom: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.login-hero h2 { font-size: 2.2rem; line-height: 1.2; margin-bottom: 14px; }
.login-hero p  { font-size: 1.1rem; opacity: .9; margin-bottom: 24px; }
.hero-points { list-style: none; display: grid; gap: 12px; }
.hero-points li { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; }
.hero-points i {
    width: 38px; height: 38px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.18); color: #FDBA74;
}

/* ---------- carte ---------- */
.login-card {
    background: var(--white);
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 25px 60px rgba(30, 10, 70, .35);
}

.login-tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
    background: var(--light-grey); border-radius: 14px; padding: 6px; margin-bottom: 24px;
}
.login-tabs button {
    border: 0; background: transparent; cursor: pointer;
    padding: 12px 8px; border-radius: 10px;
    font: inherit; font-weight: 600; font-size: .95rem; color: var(--grey);
    transition: all .2s ease;
}
.login-tabs button.active {
    background: var(--white); color: var(--primary-purple);
    box-shadow: 0 3px 10px rgba(107,70,193,.18);
}

.login-form { display: flex; flex-direction: column; }
.login-form h1 { font-size: 1.8rem; color: var(--dark-purple); }
.login-form .subtitle { color: var(--grey); margin-bottom: 22px; }
.login-form label { font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.login-form label small { color: var(--grey); font-weight: 400; }

.input-icon { position: relative; margin-bottom: 18px; }
.input-icon > i {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--light-purple);
}
.input-icon input {
    width: 100%; padding: 14px 46px 14px 46px;
    border: 2px solid #E5E7EB; border-radius: 12px;
    font: inherit; font-size: 1.05rem; background: var(--light-grey);
    outline: none; transition: all .2s ease;
}
.input-icon input:focus {
    border-color: var(--light-purple); background: var(--white);
    box-shadow: 0 0 0 4px rgba(139,92,246,.15);
}
.eye {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    border: 0; background: none; cursor: pointer; color: var(--grey); padding: 6px;
}

/* code secret */
.code-wrapper { display: flex; gap: 12px; margin-bottom: 18px; }
.code-box {
    width: 64px; height: 68px; flex: 0 0 auto;
    text-align: center; font-size: 1.8rem; font-weight: 700;
    border: 2px solid #E5E7EB; border-radius: 14px; background: var(--light-grey);
    outline: none; transition: all .15s ease; color: var(--dark-purple);
}
.code-box:focus {
    border-color: var(--orange); background: var(--white);
    box-shadow: 0 0 0 4px rgba(249,115,22,.18); transform: translateY(-2px);
}

.checkbox {
    display: flex !important; align-items: center; gap: 8px;
    font-weight: 400 !important; color: var(--grey); cursor: pointer; margin-bottom: 16px !important;
}
.checkbox input { width: 18px; height: 18px; accent-color: var(--primary-purple); }

.error {
    background: #FEF2F2; color: var(--error-red); border: 1px solid #FECACA;
    border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .95rem;
    animation: secoue .35s ease;
}
@keyframes secoue {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.login-btn {
    display: block; width: 100%; text-align: center; text-decoration: none;
    border: 0; cursor: pointer; border-radius: 14px; padding: 15px;
    font: inherit; font-size: 1.15rem; font-weight: 700; color: var(--white);
    background: linear-gradient(90deg, var(--orange), #FB923C);
    box-shadow: 0 8px 20px rgba(249,115,22,.35);
    transition: transform .15s ease, box-shadow .15s ease;
}
.login-btn:hover  { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(249,115,22,.45); }
.login-btn:active { transform: translateY(0); }
.login-btn[disabled] { opacity: .7; cursor: wait; }

.hint { text-align: center; color: var(--grey); font-size: .88rem; margin-top: 16px; }
.register-link {
    display: block; text-align: center; margin-top: 16px;
    color: var(--primary-purple); font-weight: 600; text-decoration: none;
}
.register-link:hover { text-decoration: underline; }

/* déjà connecté */
.session-box { text-align: center; display: grid; gap: 16px; justify-items: center; }
.avatar.big {
    width: 84px; height: 84px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 800; color: var(--white);
    background: linear-gradient(135deg, var(--light-purple), var(--orange));
}
.link-btn { border: 0; background: none; color: var(--grey); cursor: pointer; font: inherit; text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .login-page { grid-template-columns: 1fr; gap: 24px; padding: 24px 16px; }
    .login-hero { text-align: center; }
    .login-hero h2 { font-size: 1.6rem; }
    .hero-points { display: none; }
    .login-logo { margin-bottom: 16px; width: 220px; }
}
@media (max-width: 420px) {
    .login-card { padding: 20px 16px; }
    .code-wrapper { gap: 8px; justify-content: space-between; }
    .code-box { width: 22%; height: 60px; }
}

/* ============ Création de compte (?p=register) ============ */
.rg-choix h1, .rg-eleve h1 { font-size: 1.8rem; color: var(--dark-purple); }
.rg-role {
    width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
    border: 2px solid #EEF0F4; background: #fff; border-radius: 16px; padding: 14px 16px; margin-bottom: 10px;
    font: inherit; color: var(--dark-grey); transition: all .15s ease;
}
.rg-role:hover { border-color: var(--light-purple); background: #F5F3FF; transform: translateY(-1px); }
.rg-role b { display: block; font-size: 1.05rem; }
.rg-role small { color: var(--grey); font-size: .85rem; }
.rg-role > span:nth-child(2) { flex: 1; }
.rg-role > i { color: var(--light-purple); }
.rg-role.eleve { background: #FFF7ED; border-color: #FED7AA; }
.rg-role.eleve:hover { border-color: var(--orange); }
.rg-ico { font-size: 1.9rem; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--light-grey); border-radius: 14px; }

.rg-retour { border: 0; background: none; color: var(--grey); cursor: pointer; font: inherit; font-size: .9rem; padding: 0; margin-bottom: 10px; align-self: flex-start; }
.rg-retour:hover { color: var(--primary-purple); }
.rg-civ { display: flex; gap: 8px; margin-bottom: 14px; }
.rg-civ button { flex: 1; border: 2px solid #E5E7EB; background: #fff; border-radius: 12px; padding: 9px; font: inherit; font-weight: 600; cursor: pointer; color: var(--grey); }
.rg-civ button.on { border-color: var(--primary-purple); background: #F5F3FF; color: var(--dark-purple); }
.rg-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rg-2col > div { display: flex; flex-direction: column; }
.rg-2col .input-icon input { padding-right: 14px; }

.rg-force { display: flex; align-items: center; gap: 4px; margin: -10px 0 14px; font-size: .78rem; color: var(--grey); }
.rg-force i { width: 34px; height: 5px; border-radius: 99px; background: #E5E7EB; }
.rg-force i.on.n1 { background: var(--error-red); }
.rg-force i.on.n2 { background: #F59E0B; }
.rg-force i.on.n3, .rg-force i.on.n4 { background: var(--success-green); }
.rg-force span { margin-left: 6px; }

.rg-eleve { display: flex; flex-direction: column; }
.rg-etapes { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 6px 0 18px; }
.rg-etapes li { display: flex; gap: 12px; align-items: flex-start; }
.rg-etapes li > span {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-purple); color: #fff;
    font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.rg-etapes b { display: block; }
.rg-etapes small { color: var(--grey); }
.rg-partage { background: #F5F3FF; border-radius: 16px; padding: 14px; }
.rg-partage blockquote { background: #fff; border-left: 4px solid var(--light-purple); padding: 10px 12px; border-radius: 8px; margin: 8px 0 12px; font-size: .9rem; color: var(--dark-grey); word-break: break-word; }
.rg-partage-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rg-partage-btns .login-btn { font-size: .95rem; padding: 12px; }
.rg-wa { background: linear-gradient(90deg, #16A34A, #22C55E) !important; box-shadow: 0 8px 20px rgba(34,197,94,.3) !important; }
.rg-copie { background: #fff !important; color: var(--primary-purple) !important; border: 2px solid #C4B5FD !important; box-shadow: none !important; }
.rg-ok-t { color: var(--dark-purple); }

@media (max-width: 420px) {
    .rg-2col, .rg-partage-btns { grid-template-columns: 1fr; }
}

/* lien vers les jeux sans compte */
.hero-decouvrir {
    display: inline-flex; align-items: center; gap: 10px; margin-top: 26px;
    color: #fff; font-weight: 800; text-decoration: none;
    background: rgba(255,255,255,.16); padding: 10px 18px; border-radius: 999px;
}
.hero-decouvrir:hover { background: rgba(255,255,255,.26); }
.hero-decouvrir i { color: #FDBA74; font-size: 1.2rem; }

/* compte parent : numéro WhatsApp */
.rg-tel { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; }
.rg-tel select { height: 48px; border: 2px solid #E5E7EB; border-radius: 12px; padding: 0 8px; font: inherit; font-weight: 600; background: #fff; }
.rg-aide { margin: -8px 0 14px; font-size: .85rem; color: #15803D; }
.rg-code { font-size: 2.2rem; font-weight: 900; letter-spacing: .12em; color: #15803D; background: #F0FDF4; border: 3px dashed #86EFAC; border-radius: 16px; padding: .2em .6em; display: inline-block; margin: 6px 0 12px; }
.lg-wa { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 12px; text-decoration: none; }

/* lien vers les conditions d'utilisation */
.checkbox a { color: #6B46C1; font-weight: 700; text-decoration: underline; }
