﻿/* ═══════════════════════════════════════════════════
   06-LOGIN — صفحه ورود + Activation
   ═══════════════════════════════════════════════════ */

/* ═══ LOGIN WRAPPER ═══ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: #0F0B2E;
    background: linear-gradient(135deg, #0F0B2E 0%, #1E1B4B 50%, #312E81 100%);
}

/* ═══ تزئینات پس‌زمینه ═══ */
.login-decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.ld-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: blobFloat 20s ease-in-out infinite;
}

.ld-blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #7C3AED 0%, transparent 70%);
    top: -150px;
    right: -100px;
    animation-delay: 0s;
}

.ld-blob-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #4F46E5 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.ld-blob-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #EC4899 0%, transparent 70%);
    top: 40%;
    left: 40%;
    animation-delay: -14s;
    opacity: 0.25;
}

@keyframes blobFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -40px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.95);
    }
}

/* ═══ گرید نقطه‌ای ═══ */
.ld-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ═══ کارت اصلی ═══ */
.login-card-v2 {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 420px 460px;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    max-width: 100%;
    animation: loginCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══ ستون برند ═══ */
.login-brand-panel {
    background: linear-gradient(160deg, #1E1B4B 0%, #4F46E5 100%);
    color: #fff;
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

    .login-brand-panel::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.4), transparent 40%), radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.25), transparent 40%);
        pointer-events: none;
    }

    .login-brand-panel > * {
        position: relative;
        z-index: 1;
    }

/* ═══ لوگو ═══ */
.login-brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

    .login-brand-logo .logo-circle {
        width: 56px;
        height: 56px;
        font-size: 22px;
        background: rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 700;
    }

.login-brand-names {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-brand-name-main {
    font-size: 17px !important;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.login-brand-name-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* ═══ عنوان ═══ */
.login-brand-heading {
    margin-bottom: 32px;
}

    .login-brand-heading h1 {
        font-size: 24px;
        font-weight: 800;
        color: #fff;
        margin: 0 0 8px;
        line-height: 1.3;
        letter-spacing: -0.3px;
    }

    .login-brand-heading p {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.7);
        margin: 0;
        font-weight: 400;
    }

/* ═══ ویژگی‌ها ═══ */
.login-brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

    .login-brand-features li {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 12.5px;
    }

.lbf-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.login-brand-features li > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.login-brand-features strong {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.login-brand-features small {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* ═══ ستون فرم ═══ */
.login-form-panel {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    background: #fff;
    min-width: 0;
}

/* ═══ Mobile brand ═══ */
.login-mobile-brand {
    display: none;
}

/* ═══ Header فرم ═══ */
.login-form-header {
    margin-bottom: 24px;
}

    .login-form-header h2 {
        font-size: 22px;
        font-weight: 800;
        color: #0F172A;
        margin: 0 0 6px;
        letter-spacing: -0.3px;
    }

    .login-form-header p {
        font-size: 13px;
        color: #64748B;
        margin: 0;
    }

/* ═══ فرم ═══ */
.login-form-v2 {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.lf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

    .lf-field label {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12.5px;
        font-weight: 600;
        color: #334155;
    }

.lf-icon {
    font-size: 13px;
    line-height: 1;
}

.lf-field input,
.lf-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13.5px;
    background: #fff;
    color: #0F172A;
    transition: all 0.15s;
    box-sizing: border-box;
    min-height: 42px;
}

    .lf-field input::placeholder {
        color: #94A3B8;
    }

    .lf-field input:focus,
    .lf-field select:focus {
        outline: none;
        border-color: #4F46E5;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
        background: #FEFEFF;
    }

/* ═══ Password toggle ═══ */
.lf-password-wrap {
    position: relative;
    display: flex;
}

    .lf-password-wrap input {
        padding-left: 42px;
    }

.lf-pwd-toggle {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 15px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    opacity: 0.55;
    transition: all 0.15s;
}

    .lf-pwd-toggle:hover {
        opacity: 1;
        background: #F1F5F9;
    }

/* ═══ دکمه ورود ═══ */
.btn-login {
    width: 100%;
    padding: 13px 20px;
    margin-top: 4px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.4);
    position: relative;
    overflow: hidden;
}

    .btn-login::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }

    .btn-login:hover:not(:disabled)::before {
        left: 100%;
    }

    .btn-login:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 12px 24px -4px rgba(79, 70, 229, 0.5);
    }

    .btn-login:active:not(:disabled) {
        transform: translateY(0);
    }

    .btn-login:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

.btn-login-arrow {
    font-size: 16px;
    transition: transform 0.2s;
}

.btn-login:hover:not(:disabled) .btn-login-arrow {
    transform: translateX(-4px);
}

/* ═══ Footer فرم ═══ */
.login-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #F1F5F9;
    font-size: 11.5px;
    color: #94A3B8;
}

/* ═══ License Status ═══ */
.license-status {
    margin-bottom: 20px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.6;
    animation: licenseIn 0.3s ease;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

@keyframes licenseIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.license-status.license-valid {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.license-status.license-invalid {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.license-status.license-loading {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

.license-status::before {
    font-size: 16px;
    flex-shrink: 0;
}

.license-status.license-valid::before {
    content: '✅';
}

.license-status.license-invalid::before {
    content: '⚠️';
}

.license-status.license-loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #BFDBFE;
    border-top-color: #1E40AF;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ═══════════════════════════════════════════════════
   Activation Page
   ═══════════════════════════════════════════════════ */

/* ═══ Steps (پنل برند) ═══ */
.activation-steps {
    list-style: none;
    padding: 0;
    margin: 28px 0 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

    .activation-steps li {
        display: flex;
        align-items: center;
        gap: 12px;
        color: rgba(255, 255, 255, 0.92);
        font-size: 14px;
        line-height: 1.6;
    }

    .activation-steps .step-num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.18);
        border: 1px solid rgba(255, 255, 255, 0.3);
        font-weight: 700;
        font-size: 13px;
        flex-shrink: 0;
        backdrop-filter: blur(6px);
    }

/* ═══ Brand Footer ═══ */
.login-brand-footer {
    position: absolute;
    bottom: 24px;
    right: 32px;
    left: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}

.brand-contact {
    display: flex;
    gap: 16px;
}

.brand-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    direction: ltr;
}

    .brand-contact-item svg {
        opacity: 0.8;
    }

.brand-name {
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    letter-spacing: 0.3px;
}

/* ═══ Activation Header ═══ */
.activation-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #F1F5F9;
}

.activation-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.activation-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

.activation-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #6B7280;
}

/* ═══ System ID Box ═══ */
.activation-system-id {
    background: linear-gradient(135deg, #F5F3FF 0%, #EEF2FF 100%);
    border: 1px solid #DDD6FE;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 22px;
}

.sysid-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: #4C1D95;
    margin-bottom: 10px;
    letter-spacing: 0.2px;
}

.sysid-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 2px solid #6366F1;
    border-radius: 10px;
    padding: 8px 10px 8px 14px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

    .sysid-box span {
        flex: 1;
        font-family: Consolas, 'Courier New', monospace;
        font-size: 22px;
        font-weight: 800;
        color: #3730A3;
        letter-spacing: 3px;
        direction: ltr;
        text-align: center;
        user-select: all;
    }

    .sysid-box button {
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
        color: #fff;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: transform 0.15s, box-shadow 0.15s;
        flex-shrink: 0;
    }

        .sysid-box button:hover {
            transform: scale(1.06);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
        }

        .sysid-box button:active {
            transform: scale(0.96);
        }

.sysid-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: #6D28D9;
    line-height: 1.7;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

/* ═══ Serial Input ═══ */
.activation-form-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
}

.activation-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 4px;
    text-align: center;
    direction: ltr;
    color: #111827;
    background: #F9FAFB;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}

    .activation-input::placeholder {
        color: #9CA3AF;
        letter-spacing: 3px;
        font-weight: 500;
    }

    .activation-input:focus {
        border-color: #6366F1;
        background: #fff;
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    }

/* ═══ Submit Button ═══ */
.activation-submit {
    width: 100%;
    height: 50px;
    margin-top: 18px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

    .activation-submit:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
    }

    .activation-submit:active {
        transform: translateY(0);
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    }

    .activation-submit:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

/* ═══ Activation Footer ═══ */
.activation-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #F1F5F9;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #9CA3AF;
}

/* ═══ Activation Layout — Centering ═══ */
#activationView.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

#activationView .login-card-v2 {
    max-width: 1000px;
    width: 100%;
    min-height: 580px;
}

#activationView .login-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 40px 36px;
    overflow: hidden;
}

#activationView .login-brand-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#activationView .login-brand-footer {
    position: static;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

#activationView .login-brand-logo {
    margin-bottom: 20px;
}

#activationView .activation-steps {
    margin-top: 24px;
}

#activationView .activation-header {
    gap: 12px;
}

#activationView .activation-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

#activationView .login-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 36px;
}

#activationView .login-form-content {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .login-wrapper {
        padding: 16px;
    }

    .login-card-v2 {
        grid-template-columns: 1fr;
        max-width: 460px;
        border-radius: 20px;
    }

    .login-brand-panel {
        display: none;
    }

    .login-mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
        padding-bottom: 20px;
        border-bottom: 1px solid #F1F5F9;
    }

        .login-mobile-brand .logo-circle {
            width: 40px;
            height: 40px;
            font-size: 16px;
            background: linear-gradient(135deg, #4F46E5, #7C3AED);
            color: #fff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
        }

        .login-mobile-brand span {
            font-size: 14px;
            font-weight: 700;
            color: #0F172A;
        }

    .login-form-panel {
        padding: 28px 24px;
    }

    #activationView .login-card-v2 {
        min-height: auto;
    }

    #activationView .login-brand-panel {
        padding: 28px 20px;
    }

    #activationView .login-form-panel {
        padding: 28px 20px;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        padding: 0;
    }

    .login-card-v2 {
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
    }

    .login-form-panel {
        padding: 24px 20px;
    }

    .lf-row {
        grid-template-columns: 1fr;
    }

    .login-form-header h2 {
        font-size: 20px;
    }
}
