/* auth_theme.css — TERRA ERP Modern Auth (v3.0)
   Design: Dark Glassmorphism — Minimal, Premium, One Accent Color
*/
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

/* ─── VARIABLES ─── */
:root {
    --auth-bg: #0b0f1a;
    --auth-card: rgba(255, 255, 255, 0.04);
    --auth-card-border: rgba(255, 255, 255, 0.08);
    --auth-accent: #3b82f6;
    --auth-accent-glow: rgba(59, 130, 246, 0.25);
    --auth-text: #e2e8f0;
    --auth-text-muted: #64748b;
    --auth-input-bg: rgba(255, 255, 255, 0.05);
    --auth-input-border: rgba(255, 255, 255, 0.1);
    --auth-input-focus: rgba(59, 130, 246, 0.3);
    --auth-error: #ef4444;
}

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

body {
    background: var(--auth-bg);
    font-family: 'Cairo', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    color: var(--auth-text);
    overflow: hidden;
    position: relative;
}

/* ─── ANIMATED BACKGROUND ─── */
body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(99, 102, 241, 0.04) 0%, transparent 50%);
    animation: bgDrift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgDrift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, -1%) rotate(0.5deg); }
    50% { transform: translate(-1%, 2%) rotate(-0.5deg); }
    75% { transform: translate(1%, -2%) rotate(0.3deg); }
}

/* Floating orbs */
body::after {
    content: "";
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: orbFloat 15s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-80px, 100px) scale(1.15); }
}

/* ─── CARD ─── */
.auth-wrapper {
    background: var(--auth-card);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--auth-card-border);
    border-radius: 28px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: cardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Top accent line */
.auth-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--auth-accent), transparent);
    border-radius: 0 0 4px 4px;
}

/* ─── LOGO AREA ─── */
.auth-logo-container {
    margin-bottom: 28px;
    position: relative;
}

.logo-wrapper {
    padding: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.logo-wrapper img {
    max-height: 60px;
    max-width: 180px;
    object-fit: contain;
    filter: brightness(1.1);
}

.auth-sys-name {
    font-size: 1.7rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.auth-sys-subtitle {
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.auth-portal-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--auth-accent);
    margin-bottom: 24px;
    padding: 10px 0;
    position: relative;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.auth-portal-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--auth-accent);
    border-radius: 2px;
    opacity: 0.4;
}

/* ─── FORM ─── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form-group {
    position: relative;
    text-align: right;
}

.auth-form-group input {
    width: 100%;
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-input-border);
    border-radius: 14px;
    padding: 16px 15px 16px 45px;
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

html[dir="rtl"] .auth-form-group input {
    padding-right: 48px;
    padding-left: 15px;
}

.auth-form-group input::placeholder {
    color: var(--auth-text-muted);
    font-weight: 600;
}

.auth-form-group input:focus {
    outline: none;
    border-color: var(--auth-accent);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 4px var(--auth-input-focus), 0 0 30px rgba(59, 130, 246, 0.08);
}

/* ─── ICONS ─── */
.auth-icon {
    position: absolute;
    right: 16px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-muted);
    pointer-events: none;
    transition: color 0.35s ease, transform 0.35s ease;
}

.auth-form-group:focus-within .auth-icon {
    color: var(--auth-accent);
    transform: translateY(-50%) scale(1.1);
}

html[dir="ltr"] .auth-icon {
    left: 16px;
    right: auto;
}

/* ─── META (Remember / Forgot) ─── */
.auth-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    margin-bottom: 8px;
    font-size: 0.88rem;
}

.auth-meta a {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
    opacity: 0.8;
}

.auth-meta a:hover {
    opacity: 1;
    text-decoration: underline;
}

.auth-meta label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.auth-meta input[type="checkbox"] {
    accent-color: var(--auth-accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ─── BUTTON ─── */
.auth-btn {
    width: 100%;
    background: var(--auth-accent);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.auth-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s ease;
}

.auth-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.35);
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:active {
    transform: translateY(0);
}

/* ─── DEVELOPER FOOTER ─── */
.auth-footer-dev {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}

.dev-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.dev-brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.4s ease;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
}

.dev-brand-link:hover {
    border-color: rgba(59,130,246,0.2);
    background: rgba(59,130,246,0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59,130,246,0.15);
}

.dev-brand-logo {
    max-height: 36px;
    max-width: 130px;
    object-fit: contain;
    filter: brightness(1.1);
    transition: filter 0.3s;
}

.dev-brand-link:hover .dev-brand-logo {
    filter: brightness(1.2) drop-shadow(0 0 8px rgba(59,130,246,0.3));
}

.dev-brand-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dev-powered-by {
    font-size: 0.75rem;
    color: var(--auth-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dev-brand-name {
    font-size: 1.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--auth-accent), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    text-shadow: none;
    filter: drop-shadow(0 0 12px rgba(59,130,246,0.3));
}

.version-badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.1);
    color: var(--auth-accent);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    font-size: 0.65rem;
    text-transform: uppercase;
}

/* Contact Links Row */
.dev-contact-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.dev-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--auth-text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.dev-contact-link:hover {
    color: var(--auth-accent);
    background: rgba(59,130,246,0.08);
    border-color: rgba(59,130,246,0.15);
}

.dev-contact-link svg {
    opacity: 0.7;
    transition: opacity 0.3s;
}

.dev-contact-link:hover svg {
    opacity: 1;
}

.dev-contact-sep {
    color: rgba(255,255,255,0.15);
    font-size: 0.7rem;
    user-select: none;
}

/* Phone Numbers */
.dev-phones {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
    direction: ltr;
}

.dev-phone-link {
    color: var(--auth-text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: color 0.3s;
    font-family: 'Courier New', monospace;
}

.dev-phone-link:hover {
    color: var(--auth-accent);
}

/* Copyright */
.dev-copyright {
    font-size: 0.72rem;
    color: rgba(100, 116, 139, 0.6);
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Legacy support */
.developer-credit {
    margin-top: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    opacity: 0.6;
}

.developer-name {
    color: var(--auth-accent);
    font-weight: 800;
    opacity: 1;
}

/* ─── ERROR MESSAGE ─── */
.error-msg-card {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    padding: 14px 18px;
    border-radius: 14px;
    font-weight: 700;
    margin-bottom: 20px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 0.92rem;
    text-align: center;
    animation: shakeIn 0.5s ease;
}

@keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
    .auth-wrapper {
        margin: 16px;
        padding: 36px 24px;
        border-radius: 20px;
    }

    .auth-sys-name {
        font-size: 1.4rem;
    }
}

/* ─── PARTICLES (Pure CSS) ─── */
.auth-wrapper::after {
    content: "";
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--auth-accent);
    border-radius: 50%;
    top: 30%;
    left: 15%;
    opacity: 0.3;
    animation: particle1 12s ease-in-out infinite;
    pointer-events: none;
    box-shadow:
        90vw 10vh 0 1px rgba(59, 130, 246, 0.2),
        10vw 70vh 0 0px rgba(59, 130, 246, 0.15),
        60vw 85vh 0 2px rgba(59, 130, 246, 0.1),
        30vw 5vh 0 1px rgba(59, 130, 246, 0.2),
        80vw 55vh 0 0px rgba(59, 130, 246, 0.15);
}

@keyframes particle1 {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-20px); opacity: 0.5; }
}