/* ═══════════════════════════════════════════════════════════════════
   CortyKids — Page Auth (login + register)
   Fichier: public/assets/css/auth.css
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   1. SECTION + FOND ANIMÉ
   ═══════════════════════════════════════════════════════════════════ */

.ck-auth-section {
    position: relative;
    min-height: calc(100vh - 64px);
    padding: 60px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ck-grad-hero);
    overflow: hidden;
}

.ck-auth-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Orbites colorées qui flottent */
.ck-auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
}

.ck-auth-orb-1 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(76, 201, 240, 0.5), transparent 70%);
    top: -10%;
    left: -5%;
    animation: auth-orb-float 15s ease-in-out infinite;
}

.ck-auth-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(210, 154, 43, 0.4), transparent 70%);
    bottom: -15%;
    right: -10%;
    animation: auth-orb-float 20s ease-in-out infinite reverse;
}

.ck-auth-orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(247, 37, 133, 0.3), transparent 70%);
    top: 40%;
    left: 40%;
    animation: auth-orb-float 25s ease-in-out infinite;
}

@keyframes auth-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -30px) scale(1.15); }
    66%      { transform: translate(-30px, 20px) scale(0.9); }
}

/* ═══════════════════════════════════════════════════════════════════
   2. CARTE AUTH
   ═══════════════════════════════════════════════════════════════════ */

.ck-auth-container {
    position: relative;
    z-index: 2;
}

.ck-auth-card {
    background: var(--ck-white);
    border-radius: var(--ck-radius-lg);
    padding: 40px 32px;
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 217, 122, 0.15);
    animation: auth-card-in 0.8s var(--ck-ease-out) both;
}

@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════
   3. EN-TÊTE
   ═══════════════════════════════════════════════════════════════════ */

.ck-auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.ck-auth-mascot {
    font-size: 4rem;
    line-height: 1;
    display: inline-block;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px rgba(76, 201, 240, 0.6));
}

.ck-auth-title {
    color: var(--ck-navy);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.ck-auth-subtitle {
    color: var(--ck-gray-500);
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════════════
   4. TOGGLE USERNAME / EMAIL
   ═══════════════════════════════════════════════════════════════════ */

.ck-toggle-mode {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--ck-gray-100);
    border-radius: var(--ck-radius);
    padding: 4px;
    margin-bottom: 20px;
    isolation: isolate;
}

.ck-toggle-mode-btn {
    position: relative;
    z-index: 2;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: calc(var(--ck-radius) - 4px);
    color: var(--ck-gray-500);
    font-family: var(--ck-font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ck-toggle-mode-btn.active {
    color: var(--ck-navy);
}

.ck-toggle-mode-btn span:first-child {
    font-size: 1rem;
}

/* Slider qui glisse */
.ck-toggle-mode-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--ck-white);
    border-radius: calc(var(--ck-radius) - 4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   5. INPUTS AVEC ICÔNES
   ═══════════════════════════════════════════════════════════════════ */

.ck-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ck-input-icon {
    position: absolute;
    left: 14px;
    font-size: 1.1rem;
    color: var(--ck-gray-500);
    pointer-events: none;
    z-index: 2;
    transition: color 0.25s ease, transform 0.25s ease;
}

.ck-input-icon-left {
    padding-left: 44px !important;
}

.ck-input-icon-right {
    padding-right: 48px !important;
}

.ck-input-wrap:focus-within .ck-input-icon {
    color: var(--ck-gold);
    transform: scale(1.1);
}

/* Bouton voir/masquer mot de passe */
.ck-input-action {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--ck-gray-500);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 2;
}

.ck-input-action:hover {
    background: rgba(210, 154, 43, 0.15);
    color: var(--ck-gold);
    transform: translateY(-50%) scale(1.1);
}

.ck-pw-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.ck-input-action:active .ck-pw-icon {
    transform: scale(0.85);
}

/* ═══════════════════════════════════════════════════════════════════
   6. BOUTON SUBMIT ANIMÉ
   ═══════════════════════════════════════════════════════════════════ */

.ck-auth-submit {
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.ck-auth-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.ck-auth-submit:hover::before {
    left: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   7. LIENS + DIVIDER
   ═══════════════════════════════════════════════════════════════════ */

.ck-auth-links {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
}

.ck-auth-link {
    color: var(--ck-gray-500);
    transition: color 0.25s ease;
}

.ck-auth-link:hover {
    color: var(--ck-gold);
}

.ck-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px;
    color: var(--ck-gray-500);
    font-size: 0.85rem;
    text-align: center;
}

.ck-auth-divider::before,
.ck-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ck-gray-100);
}

/* ═══════════════════════════════════════════════════════════════════
   8. RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
    .ck-auth-section {
        padding: 30px 16px;
        min-height: calc(100vh - 56px);
    }

    .ck-auth-card {
        padding: 28px 20px;
        border-radius: var(--ck-radius);
    }

    .ck-auth-mascot { font-size: 3rem; }
    .ck-auth-title { font-size: 1.4rem; }

    .ck-toggle-mode-btn {
        font-size: 0.75rem;
        padding: 8px 6px;
    }

    .ck-toggle-mode-btn span:first-child {
        display: none;
    }
}

/* Mode sombre */
[data-theme="dark"] .ck-auth-card {
    background: var(--ck-gray-100);
}

[data-theme="dark"] .ck-auth-title {
    color: var(--ck-text-primary);
}

[data-theme="dark"] .ck-toggle-mode {
    background: var(--ck-navy);
}

[data-theme="dark"] .ck-toggle-mode-slider {
    background: var(--ck-gray-700);
}

[data-theme="dark"] .ck-toggle-mode-btn.active {
    color: var(--ck-gold);
}