/* src/mvc/View/Visitor/register.css */
/* Reprend les variables et le style de admin_user.css */

:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-2: #f9fbff;
    --text: #1c2430;
    --muted: #5a6778;
    --border: #d8e0ec;
    --primary: #1165d8;
    --primary-2: #0c4ea8;
    --danger: #d33636;
    --danger-2: #ae2828;
    --shadow: 0 8px 26px rgba(17, 52, 93, 0.08);
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", "Noto Sans", sans-serif;
    color: var(--text);
}

/* ── Layout ── */
.register-shell {
    max-width: 520px;
    margin: 40px auto;
    padding: 0 18px 40px;
}

.register-header {
    text-align: center;
    margin-bottom: 18px;
}

.register-header h2 {
    margin: 0 0 6px;
    font-size: 27px;
    line-height: 1.2;
    color: #0e2f63;
}

/* ── Flash messages ── */
.flash-success,
.flash-error,
.flash-warning {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 14px;
    box-shadow: var(--shadow);
}

.flash-success p,
.flash-error p,
.flash-warning p {
    margin: 0;
}

.flash-success {
    background: #e9faee;
    border: 1px solid #acdcbc;
}

.flash-error {
    background: #ffebeb;
    border: 1px solid #efbbbb;
}

.flash-warning {
    background: linear-gradient(135deg, #fff1f1 0%, #ffe5e5 100%);
    border: 1px solid #f2b6b6;
    border-left: 5px solid #d33636;
    color: #6f1515 !important;
    padding: 14px 16px;
}

.warning-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
}

/* ── Panel (même que admin) ── */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 14px 14px 0 0;
}

.panel-head h3 {
    margin: 0;
    font-size: 16px;
    color: #14355f;
}

.panel-body {
    padding: 18px 18px 20px;
}

/* ── Formulaire ── */
.stack-form {
    display: grid;
    gap: 12px;
}

.stack-form label {
    font-size: 13px;
    color: var(--muted);
    display: grid;
    gap: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stack-form input,
.stack-form select {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: var(--text);
    transition: border-color 150ms ease, outline 150ms ease;
}

.stack-form input:focus,
.stack-form select:focus {
    outline: 2px solid rgba(17, 101, 216, 0.25);
    outline-offset: 1px;
    border-color: #93b6f0;
}

/* ── Champ mot de passe avec bouton œil ── */
.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap input {
    padding-right: 38px;
}

.toggle-pw {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 36px;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 8px 8px 0;
    padding: 0;
    transition: color 120ms ease;
}

.toggle-pw:hover {
    color: var(--primary);
    background: transparent;
    transform: none;
}

/* ── Indications sous champ ── */
.optional {
    font-weight: 400;
    font-size: 12px;
    color: #94a3b8;
    margin-left: 4px;
}

.field-hint {
    font-size: 12px;
    margin-top: 2px;
    min-height: 16px;
    display: block;
}

.hint-ok {
    color: #276637;
}

.hint-error {
    color: var(--danger);
}

/* ── Boutons ── */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

button,
.btn-primary {
    border: none;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 120ms ease, background 120ms ease;
    background: var(--primary);
    color: #fff;
}

button:hover,
.btn-primary:hover {
    background: var(--primary-2);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

button.btn-warning,
.warning-actions .btn-warning {
    background: #d33636 !important;
    color: #fff !important;
    border: 1px solid #a92323;
}

button.btn-warning:hover,
.warning-actions .btn-warning:hover {
    background: #ae2828 !important;
}

/* ── Lien vers login ── */
.login-link {
    text-align: center;
    margin: 0;
    font-size: 13px;
}

.login-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

/* ── Responsive ── */
@media (max-width: 560px) {
    .register-shell {
        margin: 16px auto;
        padding: 0 12px 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .register-header h2 {
        font-size: 22px;
    }
}