/* ── Mawjona Auth Pages ── */

/* Design tokens — match app-shell.css palette */
:root {
    --auth-bg:          #faf7f2;
    --auth-accent:      #7c3aed;
    --auth-accent-dark: #6d28d9;
    --auth-gold:        #b7882c;
    --auth-text:        #1e1218;
    --auth-muted:       #7c6e7a;
    --auth-border:      #e8ddd4;
    --auth-surface:     #ffffff;
    --auth-error-bg:    #fef2f2;
    --auth-error-text:  #991b1b;
    --auth-error-border:#fecaca;
    --auth-success-bg:  #f0fdf4;
    --auth-success-text:#166534;
    --auth-success-border:#bbf7d0;
    --auth-radius:      14px;
    --auth-shadow:      0 8px 40px rgba(30, 18, 24, 0.10);
    --auth-font:        'Cairo', system-ui, sans-serif;
}

/* Reset for auth pages */
body.icrm-auth-body {
    margin: 0;
    padding: 0;
    background: var(--auth-bg);
    font-family: var(--auth-font);
    color: var(--auth-text);
    min-height: 100vh;
    direction: rtl;
}

/* Suppress WP admin bar if somehow present */
body.icrm-auth-body #wpadminbar { display: none !important; }
body.icrm-auth-body { margin-top: 0 !important; padding-top: 0 !important; }

/* ── Page layout ── */
.icrm-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    overflow: hidden;
}

/* Decorative blobs */
.icrm-auth-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
}
.icrm-auth-blob--1 {
    width: 500px;
    height: 500px;
    background: var(--auth-accent);
    top: -180px;
    left: -120px;
}
.icrm-auth-blob--2 {
    width: 400px;
    height: 400px;
    background: var(--auth-gold);
    bottom: -160px;
    right: -100px;
}

/* ── Card ── */
.icrm-auth-card {
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* ── Brand / Logo ── */
.icrm-auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.icrm-auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--auth-accent), var(--auth-gold));
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    border-radius: 14px;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.icrm-auth-tagline {
    margin: 0;
    font-size: 13px;
    color: var(--auth-muted);
    font-weight: 500;
}

/* ── Headings ── */
.icrm-auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--auth-text);
    margin: 0 0 6px;
    text-align: center;
}

.icrm-auth-subtitle {
    font-size: 14px;
    color: var(--auth-muted);
    margin: 0 0 24px;
    text-align: center;
}

/* ── Alerts ── */
.icrm-auth-alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid;
    line-height: 1.6;
}
.icrm-auth-alert--error {
    background: var(--auth-error-bg);
    color: var(--auth-error-text);
    border-color: var(--auth-error-border);
}
.icrm-auth-alert--success {
    background: var(--auth-success-bg);
    color: var(--auth-success-text);
    border-color: var(--auth-success-border);
}

/* ── Form fields ── */
.icrm-auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.icrm-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.icrm-auth-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.icrm-auth-forgot {
    font-size: 12px;
    font-weight: 400;
    color: var(--auth-accent);
    text-decoration: none;
}
.icrm-auth-forgot:hover { text-decoration: underline; }

.icrm-auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.icrm-auth-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--auth-border);
    border-radius: 9px;
    font-size: 15px;
    font-family: var(--auth-font);
    color: var(--auth-text);
    background: var(--auth-bg);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    direction: rtl;
}

.icrm-auth-input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
    background: #fff;
}

.icrm-auth-input::placeholder { color: #bbb3b8; }

/* Password toggle button inside wrap */
.icrm-auth-input-wrap .icrm-auth-input {
    padding-left: 42px; /* space for toggle btn (LTR side in RTL layout) */
}

.icrm-auth-toggle-pwd {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--auth-muted);
    padding: 4px;
    display: flex;
    align-items: center;
}
.icrm-auth-toggle-pwd:hover { color: var(--auth-accent); }
.icrm-auth-toggle-pwd.is-active { color: var(--auth-accent); }

/* ── Remember me ── */
.icrm-auth-remember { margin-top: -4px; }

.icrm-auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--auth-muted);
    cursor: pointer;
    user-select: none;
}

.icrm-auth-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-accent);
    cursor: pointer;
}

/* ── Terms ── */
.icrm-auth-terms {
    font-size: 12px;
    color: var(--auth-muted);
    text-align: center;
    margin: -4px 0 0;
    line-height: 1.6;
}
.icrm-auth-link {
    color: var(--auth-accent);
    text-decoration: none;
}
.icrm-auth-link:hover { text-decoration: underline; }

/* ── Submit button ── */
.icrm-auth-submit {
    width: 100%;
    padding: 13px;
    background: var(--auth-accent);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 16px;
    font-family: var(--auth-font);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    margin-top: 4px;
}
.icrm-auth-submit:hover {
    background: var(--auth-accent-dark);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.28);
    transform: translateY(-1px);
}
.icrm-auth-submit:active { transform: translateY(0); }

/* ── Switch link (login ↔ register) ── */
.icrm-auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--auth-muted);
    margin: 20px 0 0;
}
.icrm-auth-switch-link {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}
.icrm-auth-switch-link:hover { text-decoration: underline; }

/* ── Mobile ── */
@media (max-width: 480px) {
    .icrm-auth-card {
        padding: 28px 20px;
    }
    .icrm-auth-title { font-size: 20px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .icrm-auth-submit,
    .icrm-auth-input { transition: none; }
}

/* ════════════════════════════════════════════════════
   Registration Wizard — added 2026-04-06
════════════════════════════════════════════════════ */

/* Progress bar */
.icrm-reg-progress {
    height: 4px;
    background: var(--auth-border);
    border-radius: 99px;
    margin-bottom: 6px;
    overflow: hidden;
}
.icrm-reg-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--auth-accent), var(--auth-gold));
    border-radius: 99px;
    transition: width 0.35s ease;
    width: 0%;
}
.icrm-reg-step-label {
    font-size: 12px;
    color: var(--auth-muted);
    text-align: center;
    margin: 0 0 20px;
}

/* Steps — only the active one is visible */
.icrm-reg-step {
    display: none;
}
.icrm-reg-step.is-active {
    display: block;
}

/* Step heading */
.icrm-auth-step-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--auth-text);
    margin: 0 0 4px;
}
.icrm-auth-step-sub {
    font-size: 13px;
    color: var(--auth-muted);
    margin: 0 0 20px;
}

/* Two-column layout for paired fields */
.icrm-auth-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Platform rows */
.icrm-platform-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--auth-border);
}
.icrm-platform-row:last-of-type {
    border-bottom: none;
}
.icrm-platform-icon {
    font-size: 18px;
    margin-top: 28px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icrm-platform-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}
.icrm-platform-inputs {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 8px;
    align-items: end;
}
.icrm-auth-field--followers label {
    white-space: nowrap;
}

/* Radio groups */
.icrm-auth-radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.icrm-auth-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--auth-text);
    cursor: pointer;
}
.icrm-auth-radio {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-accent);
    cursor: pointer;
}

/* Required / optional markers */
.icrm-req { color: var(--auth-error-text); font-size: 12px; }
.icrm-opt { color: var(--auth-muted); font-size: 12px; font-weight: 400; }

/* Validation error highlight */
.icrm-input-error {
    border-color: var(--auth-error-border) !important;
    background: var(--auth-error-bg) !important;
}

/* Wizard nav */
.icrm-reg-nav {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}
.icrm-reg-nav .icrm-auth-submit {
    flex: 1;
    margin: 0;
}
.icrm-reg-btn--ghost {
    background: transparent !important;
    color: var(--auth-accent) !important;
    border: 1px solid var(--auth-accent) !important;
    box-shadow: none !important;
}
.icrm-reg-btn--ghost:hover {
    background: color-mix(in srgb, var(--auth-accent) 8%, transparent) !important;
}

/* Mobile tweaks */
@media (max-width: 480px) {
    .icrm-auth-row2 { grid-template-columns: 1fr; }
    .icrm-platform-inputs { grid-template-columns: 1fr; }
    .icrm-platform-icon { display: none; }
}
