@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;600&display=swap");

:root {
    --color-bg: #1e1e1e;
    --color-bg-2: #090909;
    --color-node-bg: #212121;
    --color-field-bg: #00000010;
    --color-surface: #2a2a2a;
    --color-surface-light: #3a3a3a;
    --color-border: rgb(51 51 51);
    --color-text: #a5a5a5;
    --color-text-muted: #666;
    --color-text-light: #e0e0e0;
    --color-primary: #009BA0;
    --color-output: #FF00AE;
    --color-text-input: #0084FF;
    --color-text-output: #AE00FF;
    --color-white-soft: rgba(255, 255, 255, 0.9);
    --shadow-glow: 0 0 15px rgba(255, 255, 255, 0.05);
    --shadow-active: 0 0 20px rgba(0, 155, 160, 0.2);
    --color-success: #22c55e;
    --color-danger: #ef4444;
    --color-scheme: dark;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-node: 7px 7px 20px #00000045, 2px 2px 15px #00000025;
    --font-roboto: "Roboto", sans-serif;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-ui: 10px; /* arrondi UNIQUE boutons/champs — aligné app-styles.css (David 2026-05-24) */
    --spacing-xs: 4px;
    --spacing-sm: 6px;
    --spacing-md: 8px;
    --spacing-lg: 10px;
    --spacing-xl: 12px;
    --spacing-2xl: 15px;
    --spacing-3xl: 20px;
    --transition-normal: 0.2s ease;
}

body.light-mode {
    --color-bg: #f5f5f5;
    --color-bg-2: #ffffff;
    --color-node-bg: #ffffff;
    --color-field-bg: #00000008;
    --color-surface: #ffffff;
    --color-surface-light: #fafafa;
    --color-border: #e0e0e0;
    --color-text: #666666;
    --color-text-muted: #999999;
    --color-text-light: #333333;
    --color-primary: #00adb3;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-node: 7px 7px 20px #00000015, 2px 2px 15px #00000010;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 10px;
    /* width: 100%; */
    min-width: 320px;
    /* max-width: 400px; */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    flex-direction: column;
}

.auth-container.register {
    max-width: 500px;
}

.auth-header {
    text-align: center;
}

.logo {
    /* Logo Echo (portrait) : même hauteur utile que dans l'en-tête de l'app (25/09). */
    height: 40px;
    width: auto;
}

h1 {
    color: var(--color-primary);
    font-size: 1.4em;
    font-weight: 600;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 1em;
    margin-top: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    display: block;
    color: var(--color-text);
    font-size: 1em;
}

input,
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-bg);
    border: 1px solid #444;
    border-radius: 10px;
    color: var(--color-text);
    font-size: 16px;
    transition: all 0.2s;
}

input:focus,
select:focus {
    outline: none;
}

input::placeholder {
    color: #666;
}

.auth-button {
    width: 100%;
    padding: 12px;
    background: var(--color-primary);
    border: none;
    border-radius: 6px;
    color: var(--color-bg);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-button:hover:not(:disabled) {
    background: #00adb3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 155, 160, 0.3);
}

.auth-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message {
    padding: 10px;
    border-radius: 4px;
    font-size: 1em;
    text-align: center;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.info-message {
    background: rgba(0, 155, 160, 0.1);
    border: 1px solid rgba(0, 155, 160, 0.3);
    color: var(--color-primary);
}

.test-accounts {
    /* margin-top: 30px; */
    padding-top: 10px;
    border-top: 1px solid #333;
}

.test-accounts h3 {
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    text-align: center;
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-account {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--color-bg);
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.test-account:hover {
    border-color: var(--color-primary);
    background: #242424;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-avatar {
    width: 24px;
    height: 24px;
    background: var(--color-primary);
    color: var(--color-bg);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.account-name {
    color: #a5a5a5;
}

.account-username {
    color: var(--color-primary);
    font-family: monospace;
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
}

.checkbox-group label {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.checkbox-group a {
    color: var(--color-primary);
    text-decoration: none;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

.auth-link {
    text-align: center;
    /* border-top: 1px solid #333; */
    font-size: 1em;
}

.auth-link a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

.gender-select {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.gender-option {
    position: relative;
}

.gender-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.gender-option label {
    display: block;
    padding: 10px;
    text-align: center;
    background: var(--color-bg);
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.gender-option input[type="radio"]:checked+label {
    border-color: var(--color-primary);
    background: rgba(0, 155, 160, 0.1);
    color: var(--color-primary);
}

.gender-option label:hover {
    border-color: var(--color-primary);
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select .select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-bg);
    border: 1px solid #444;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-select .select-trigger:hover {
    border-color: var(--color-primary);
}

.custom-select.open .select-trigger {
    border-color: var(--color-primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select .select-trigger i {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s;
}

.custom-select.open .select-trigger i {
    transform: rotate(180deg);
}

.custom-select .select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-primary);
    border-top: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.custom-select.open .select-options {
    display: block;
}

.custom-select .select-option {
    padding: 12px 16px;
    color: #a5a5a5;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-select .select-option:hover {
    background: #2a2a2a;
    color: var(--color-primary);
}

.custom-select .select-option.selected {
    background: rgba(0, 155, 160, 0.1);
    color: var(--color-primary);
}

.notif {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 1em;
    animation: slideIn 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.notif-success {
    background: #22c55e;
    color: var(--color-bg);
}

.notif-error {
    background: #ef4444;
    color: white;
}

.notif-info {
    background: var(--color-primary);
    color: var(--color-bg);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 500px) {
    .auth-container {
        margin: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Arrondi UI homogène (auth : login/register) — même 10px que le reste (David 2026-05-24). */
input, select, textarea, .auth-button, .gender-option label { border-radius: var(--radius-ui); }