
/* ========================================
   LOGIN PAGE - TelusMaroc CRC
   ======================================== */
   
:root {
    --primary: #4040E6;
    --primary-light: #6B6BFF;
    --primary-dark: #2D2DB3;
    --primary-gradient: linear-gradient(135deg, #4040E6, #6B6BFF);
    --bg-light: #F0F2F5;
    --white: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 48px rgba(64,64,230,0.15);
    --radius: 16px;
    --radius-sm: 10px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    background: var(--bg-light);
    overflow-x: hidden;
}

/* ── Animated Background ── */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
.bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #EEF0FF 0%, #F0F2F5 30%, #E8ECFF 60%, #F5F3FF 100%);
}
.floating-shapes {
    position: absolute;
    inset: 0;
}
.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    filter: blur(1px);
}
.shape-1 {
    width: 300px; height: 300px;
    background: var(--primary);
    top: -50px; right: -80px;
    animation: float1 20s ease-in-out infinite;
}
.shape-2 {
    width: 200px; height: 200px;
    background: var(--primary-light);
    bottom: 10%; left: -60px;
    animation: float2 25s ease-in-out infinite;
}
.shape-3 {
    width: 150px; height: 150px;
    background: #818CF8;
    top: 40%; right: 20%;
    animation: float3 18s ease-in-out infinite;
}
.shape-4 {
    width: 100px; height: 100px;
    background: var(--primary);
    bottom: 20%; right: 10%;
    animation: float1 22s ease-in-out infinite reverse;
}
.shape-5 {
    width: 80px; height: 80px;
    background: #A5B4FC;
    top: 20%; left: 30%;
    animation: float2 15s ease-in-out infinite;
}
.shape-6 {
    width: 120px; height: 120px;
    background: var(--primary-light);
    top: 60%; left: 10%;
    animation: float3 20s ease-in-out infinite reverse;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 30px) scale(0.95); }
}
@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(40px, -40px) rotate(180deg); }
}
@keyframes float3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-30px, 20px); }
    50% { transform: translate(20px, -30px); }
    75% { transform: translate(-10px, -20px); }
}

/* ── Login Container ── */
.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}
.reset-container {
    align-items: center;
    justify-content: center;
}

/* ── Branding Panel ── */
.login-branding {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    padding: 48px;
    position: relative;
    overflow: hidden;
}
.login-branding::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.branding-content {
    position: relative;
    text-align: center;
    max-width: 420px;
    color: white;
}
.branding-logo {
    width: 240px;
    margin-bottom: 32px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}
.branding-content h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}
.branding-content p {
    font-size: 16px;
    opacity: 0.85;
    margin-bottom: 32px;
}
.branding-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    opacity: 0.9;
    padding: 10px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
    transition: all 0.3s;
}
.feature-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(4px);
}
.feature-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* ── Form Panel ── */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--white);
}
.login-step {
    display: none;
    width: 100%;
    max-width: 400px;
}
.login-step.active {
    display: block;
    animation: fadeInStep 0.4s ease-out;
}
@keyframes fadeInStep {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Form Header ── */
.form-header {
    text-align: center;
    margin-bottom: 32px;
}
.form-logo {
    height: 56px;
    margin-bottom: 24px;
}
.form-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.form-header p {
    font-size: 14px;
    color: var(--text-secondary);
}
.icon-circle {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.icon-circle i {
    font-size: 28px;
    color: white;
}
.icon-circle.success {
    background: linear-gradient(135deg, #10B981, #34D399);
}

/* ── Form Elements ── */
.form-group {
    margin-bottom: 20px;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrapper i:first-child {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 16px;
    transition: color 0.3s;
    z-index: 1;
}
.input-wrapper input {
    width: 100%;
    padding: 14px 48px 14px 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-light);
    transition: all 0.3s;
    outline: none;
}
.input-wrapper label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s;
}
.input-wrapper input:focus,
.input-wrapper input:not(:placeholder-shown) {
    border-color: var(--primary);
    background: var(--white);
}
.input-wrapper input:focus ~ label,
.input-wrapper input:not(:placeholder-shown) ~ label {
    top: -8px;
    left: 12px;
    font-size: 12px;
    color: var(--primary);
    background: var(--white);
    padding: 0 6px;
}
.input-wrapper input:focus ~ i:first-child {
    color: var(--primary);
}
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color 0.3s;
}
.toggle-password:hover { color: var(--primary); }

/* ── Alerts ── */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}
.alert-error {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}
.alert-success {
    background: #F0FDF4;
    color: #16A34A;
    border: 1px solid #BBF7D0;
}
.alert-warning {
    background: #FFFBEB;
    color: #D97706;
    border: 1px solid #FDE68A;
}

/* ── Buttons ── */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(64,64,230,0.35);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0); }
.btn-primary .btn-loader { display: none; }
.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .btn-icon { display: none; }
.btn-primary.loading .btn-loader { display: inline-flex; }

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}
.btn-link:hover { color: var(--primary-dark); }
.btn-back {
    margin-top: 24px;
    justify-content: center;
    width: 100%;
    color: var(--text-secondary);
}
.btn-back:hover { color: var(--primary); }

/* ── Form Options ── */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}
.checkbox-wrapper input { display: none; }
.checkmark {
    width: 18px; height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.checkbox-wrapper input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}
.checkbox-wrapper input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: white;
}
.forgot-link {
    color: var(--primary);
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}
.forgot-link:hover { color: var(--primary-dark); }

/* ── 2FA Code Inputs ── */
.code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 24px 0;
}
.code-input {
    width: 52px; height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
}
.code-input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(64,64,230,0.15);
    transform: scale(1.05);
}
.code-timer {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.countdown {
    font-weight: 600;
    color: var(--primary);
    margin-left: 4px;
}
.resend-section {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

/* ── Password Strength ── */
.password-strength {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: all 0.3s;
    width: 0;
}
.strength-fill.weak { background: var(--danger); }
.strength-fill.fair { background: #F97316; }
.strength-fill.good { background: var(--warning); }
.strength-fill.strong { background: #84CC16; }
.strength-fill.excellent { background: var(--success); }
#strength-text { font-size: 12px; color: var(--text-muted); }
.password-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 12px 0 24px;
}
.rule {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.rule i { font-size: 8px; }
.rule.valid { color: var(--success); }

/* ── Animations ── */
.animate-fadeIn { animation: fadeIn 0.6s ease-out both; }
.animate-fadeInUp { animation: fadeInUp 0.6s ease-out both; }
.animate-bounceIn { animation: bounceIn 0.8s ease-out both; }
.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .login-container { flex-direction: column; }
    .login-branding {
        padding: 32px 24px;
        min-height: auto;
    }
    .branding-logo { width: 160px; margin-bottom: 16px; }
    .branding-content h1 { font-size: 22px; }
    .branding-features { display: none; }
    .login-form-panel { padding: 32px 24px; }
    .code-input { width: 44px; height: 52px; font-size: 20px; }
}
@media (max-width: 480px) {
    .login-branding { padding: 24px 16px; }
    .branding-content h1 { font-size: 18px; }
    .login-form-panel { padding: 24px 16px; }
    .form-options { flex-direction: column; gap: 12px; align-items: flex-start; }
}
