@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --color-primary: rgba(14, 54, 100, 1);
    --color-accent: #00b74a;
    --color-muted: #354e6f;
    --color-linear-primary: linear-gradient(140deg, rgba(17, 45, 57, 1) 0%, rgba(14, 54, 100, 1) 100%);
    --text-on-primary: #ffffff;
    --text-on-accent: #000000;
    --text-on-muted: #ffffff;
    --color-primary-90: rgba(30, 58, 95, 0.9);
    --color-primary-70: rgba(30, 58, 95, 0.7);
    --color-accent-90: rgba(0, 183, 74, 0.9);
    --color-muted-85: rgba(53, 78, 111, 0.85);

    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-strong: rgba(255, 255, 255, 0.08);
    --surface: rgba(10, 20, 40, 0.75);
    --surface-card: rgba(15, 28, 55, 0.85);
    --accent-glow: rgba(0, 183, 74, 0.25);
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: url('https://images.unsplash.com/photo-1504384308090-c894fdcc538d') center/cover fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(8, 15, 30, 0.88) 0%,
        rgba(14, 54, 100, 0.75) 50%,
        rgba(0, 30, 20, 0.82) 100%);
    backdrop-filter: blur(3px);
}

/* Orbs décoratifs */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 50%, rgba(0, 183, 74, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 80% 20%, rgba(14, 54, 100, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* ============================================================
   APP WRAPPER
============================================================ */
.app {
    width: 100%;
    max-width: 860px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    z-index: 999;
    box-shadow:
        0 60px 120px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255,255,255,0.05),
        inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(24px);
    animation: fadeUp .8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   HEADER
============================================================ */
.header {
    position: relative;
    padding: 36px 32px 42px;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(160deg,
        rgba(0, 183, 74, 0.15) 0%,
        rgba(14, 54, 100, 0.35) 50%,
        rgba(17, 45, 57, 0.4) 100%);
    border-bottom: 1px solid var(--glass-border);
}

.header::before {
    content: '';
    position: absolute;
    top: -80px; left: 50%;
    transform: translateX(-50%);
    width: 400px; height: 200px;
    background: radial-gradient(ellipse, rgba(0, 183, 74, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,183,74,0.4), transparent);
}

.logo {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--color-accent), #008c38);
    border-radius: 14px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 183, 74, 0.35), 0 0 0 1px rgba(0,183,74,0.3);
    position: relative;
}

.header h1 {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 22px;
    color: #fff;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.header > p {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.02em;
}

/* ============================================================
   STEPS
============================================================ */
.steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.4s ease;
}

.step span {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.4s ease;
}

.step.active {
    background: rgba(0, 183, 74, 0.15);
    border-color: rgba(0, 183, 74, 0.4);
    color: #fff;
    font-weight: 600;
}

.step.active span {
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 183, 74, 0.5);
}

.arrow {
    font-size: 14px;
    color: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    animation: arrowIdle 2s infinite;
    transition: .3s;
}

.arrow.active {
    color: var(--color-accent);
    animation: arrowMove 1s infinite;
    filter: drop-shadow(0 0 6px rgba(0,183,74,0.6));
}

@keyframes arrowMove {
    0%   { transform: translateX(0); opacity: .5; }
    50%  { transform: translateX(5px); opacity: 1; }
    100% { transform: translateX(0); opacity: .5; }
}
@keyframes arrowIdle {
    0%, 100% { opacity: .2; }
    50%       { opacity: .4; }
}

/* ============================================================
   CONTENT
============================================================ */
.content {
    padding: 32px;
    color: #e2e8f0;
}

.content.feat { padding: 10px; }

/* ============================================================
   SECTION ACCUEIL — FEATURES
============================================================ */
#home h2 {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 6px;
}

#home > center > p,
#home p {
    color: rgba(255,255,255,0.5);
    text-align: center;
    font-size: 13px;
    margin-bottom: 28px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    opacity: 0;
    transform: translateY(16px);
    animation: featureIn .5s ease forwards;
    transition: all 0.3s ease;
    cursor: default;
}

.feature:nth-child(1) { animation-delay: .08s }
.feature:nth-child(2) { animation-delay: .16s }
.feature:nth-child(3) { animation-delay: .24s }
.feature:nth-child(4) { animation-delay: .32s }
.feature:nth-child(5) { animation-delay: .40s }
.feature:nth-child(6) { animation-delay: .48s }

.feature:hover {
    border-color: rgba(0, 183, 74, 0.35);
    background: rgba(0, 183, 74, 0.07);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 183, 74, 0.1);
}

.feature i {
    font-size: 1rem;
    color: var(--color-accent);
    margin-top: 2px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(0,183,74,0.4));
}

.feature .content.feat strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
}

.feature .content.feat span {
    display: block;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.45;
}

/* ============================================================
   BUTTON
============================================================ */
.btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, var(--color-accent), #007a32);
    color: #fff;
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 183, 74, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity .3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 183, 74, 0.45);
}

.btn:hover::before { opacity: 1; }
.btn:active { transform: translateY(0); }

/* ============================================================
   FORMULAIRE DE CONNEXION
============================================================ */
#login h2, #companies h2 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #fff;
}

#login > center > p,
#companies > div > p {
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    margin-bottom: 24px;
}

/* BACK LINK */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    margin-bottom: 18px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    transition: all .25s ease;
    letter-spacing: 0.02em;
}

.back-link i { font-size: 11px; transition: transform .25s ease; }

.back-link:hover {
    color: var(--color-accent);
    border-color: rgba(0, 183, 74, 0.3);
    background: rgba(0, 183, 74, 0.08);
}

.back-link:hover i { transform: translateX(-3px); }

/* SWITCH */
.switch-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.switch-bg {
    position: relative;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 4px;
    width: 230px;
    display: flex;
    align-items: center;
}

.switch-btn {
    position: relative;
    z-index: 2;
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: color 0.3s ease;
}

.switch-btn.active { color: #fff; }

.switch-indicator {
    position: absolute;
    top: 4px; left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, var(--color-accent), #007a32);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 183, 74, 0.35);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-bg.az-active .switch-indicator {
    transform: translateX(100%);
}

/* INPUTS */
.group {
    margin-bottom: 16px;
}

.group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    margin-bottom: 7px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.input-icon {
    position: relative;
}

.input-icon input {
    width: 100%;
    padding: 13px 44px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-icon input::placeholder { color: rgba(255,255,255,0.25); }

.input-icon input:focus {
    border-color: rgba(0, 183, 74, 0.5);
    background: rgba(0, 183, 74, 0.06);
    box-shadow: 0 0 0 3px rgba(0, 183, 74, 0.12);
}

.icon-left {
    position: absolute;
    top: 50%; left: 14px;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.3);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color .3s;
}

.icon-right {
    position: absolute;
    top: 50%; right: 14px;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.3);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color .3s;
}

.icon-right:hover { color: var(--color-accent); }

.input-icon:focus-within .icon-left { color: var(--color-accent); }

/* AZ CODE */
#azTab small {
    display: block;
    color: rgba(255,255,255,0.45);
    font-size: 12px;
    margin-bottom: 4px;
}

.az-code {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 14px 0 6px;
}

.az-input { position: relative; }

.az-code input {
    width: 54px; height: 54px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-family: 'Syne', sans-serif;
    transition: all .25s ease;
    outline: none;
}

.az-code input:focus {
    border-color: rgba(0, 183, 74, 0.5);
    background: rgba(0, 183, 74, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 183, 74, 0.15);
}

/* FORGOT + REMEMBER */
.forgot {
    text-align: right;
    margin: -4px 0 14px;
}

.forgot a {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    transition: color .2s;
}

.forgot a:hover { color: var(--color-accent); }

.login-options {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.45);
}

.login-options input[type="checkbox"] {
    accent-color: var(--color-accent);
    width: 14px; height: 14px;
}

/* ERROR */
#errormsg {
    display: block;
    font-size: 12px;
    color: #ff6b6b;
    margin: -10px 0 10px;
    min-height: 16px;
}

/* ============================================================
   ENTREPRISE CARDS
============================================================ */
.company-card {
    min-height: 190px;
    padding: 20px 14px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.company-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 183, 74, 0.4);
    background: rgba(0, 183, 74, 0.06);
    box-shadow: 0 12px 36px rgba(0, 183, 74, 0.12);
}

.company-avatar {
    width: 68px; height: 68px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    transition: border-color .3s;
}

.company-card:hover .company-avatar {
    border-color: rgba(0, 183, 74, 0.4);
}

.company-avatar img {
    width: 100%; height: 100%;
    object-fit: contain;
}

.company-card h6 {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85) !important;
    margin: 0 0 10px;
}

.company-card .login-btn {
    width: 100%;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--color-accent), #007a32);
    color: #fff;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 4px 14px rgba(0,183,74,0.25);
}

.company-card .login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0,183,74,0.4);
}

/* ============================================================
   FOOTER
============================================================ */
.az-footer {
    background: rgba(5, 12, 25, 0.8);
    border-top: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    padding: 18px 24px;
}

.az-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .az-footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
        text-align: left;
    }
}

.az-footer-brand {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    align-items: center;
    color: rgba(255,255,255,0.45);
}

.az-footer-brand .bold {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    color: #fff;
    font-size: 13px;
}

.brand-suite {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.brand-suite img { height: 14px; opacity: .6; }

.suite-name {
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 12px;
}

.az-footer-socials {
    display: flex;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
}

.az-footer-socials a {
    width: 30px; height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.35);
    transition: all .25s ease;
    text-decoration: none;
    font-size: 11px;
}

.az-footer-socials a:hover {
    background: rgba(0, 183, 74, 0.15);
    border-color: rgba(0, 183, 74, 0.3);
    color: var(--color-accent);
    transform: translateY(-2px);
}

.az-footer-copy { text-align: center; }

.erp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.erp img { height: 14px; opacity: .6; }
.heart { color: #ef4444; }

.copyright {
    margin-top: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.3);
}

.copyright a {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
}

/* ============================================================
   DIVIDER DÉCORATIF
============================================================ */
.form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.form-divider span {
    font-size: 11px;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ============================================================
   ANIMATIONS
============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(32px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes featureIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   TOGGLE PASSWORD
============================================================ */
.toggle-password:hover { color: var(--color-accent); }

/* ============================================================
   UTILITIES
============================================================ */
.hidden { display: none !important; }

img { max-width: 100%; height: auto; }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 600px) {
    body {
        align-items: flex-start;
        padding: 0;
    }

    .app {
        border-radius: 0;
        border-left: none;
        border-right: none;
        min-height: 100vh;
    }

    .header { padding: 28px 20px 32px; }
    .content { padding: 22px 18px; }

    .steps { gap: 6px; }
    .step { padding: 5px 10px; font-size: 11px; }
    .step span { width: 16px; height: 16px; font-size: 9px; }

    .az-footer { padding: 16px; }
    .az-footer-grid { gap: 16px; }

    .features { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 400px) {
    .az-code { gap: 6px; }
    .az-code input { width: 46px; height: 46px; font-size: 1rem; }
}
