﻿:root {
    --brand-dark: #10233a;
    --brand-navy: #16324a;
    --brand-blue: #2c4964;
    --brand-cyan: #47b2e4;
    --brand-cyan-soft: #7fd0f2;
    --text-light: #eaf3f9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Roboto", "Poppins", sans-serif;
    background: var(--brand-dark);
}

/* ---------- کانتینر اصلی ---------- */
.login-wrapper {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-navy) 55%, #0d1c2e 100%);
}

/* ---------- بلاب‌های گرادیانی متحرک ---------- */
.bg-blobs {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    animation: blob-move 18s ease-in-out infinite;
}

.blob-1 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, var(--brand-cyan) 0%, transparent 70%);
    top: -100px;
    right: -80px;
    animation-duration: 20s;
}

.blob-2 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, #2c8fc9 0%, transparent 70%);
    bottom: -120px;
    left: -60px;
    animation-duration: 24s;
    animation-delay: -6s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--brand-cyan-soft) 0%, transparent 70%);
    top: 40%;
    left: 45%;
    animation-duration: 16s;
    animation-delay: -3s;
    opacity: 0.35;
}

@keyframes blob-move {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 20px) scale(0.95);
    }
}

/* ---------- پارتیکل‌های canvas ---------- */
#particles-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
}

/* ---------- گرید دو ستونه ---------- */
.login-grid {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}

@media (max-width: 900px) {
    .login-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- پنل برندینگ ---------- */
.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 70px;
    color: var(--text-light);
    animation: panel-fade-in 0.8s ease both;
}

@media (max-width: 900px) {
    .brand-panel {
        padding: 50px 30px 30px;
        text-align: center;
        align-items: center;
    }
}

@keyframes panel-fade-in {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-light);
    margin-bottom: 50px;
    width: fit-content;
}

@media (max-width: 900px) {
    .brand-logo {
        margin-inline: auto;
    }
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-cyan), #2c8fc9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 8px 20px rgba(71, 178, 228, 0.4);
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.brand-copy h1 {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 18px;
    background: linear-gradient(90deg, #fff, var(--brand-cyan-soft));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-copy p {
    font-size: 1rem;
    color: #b7cbdb;
    max-width: 420px;
    line-height: 1.9;
}

@media (max-width: 900px) {
    .brand-copy p {
        max-width: 100%;
    }
}

.brand-stats {
    display: flex;
    gap: 36px;
    margin-top: 40px;
}

@media (max-width: 900px) {
    .brand-stats {
        justify-content: center;
        gap: 24px;
    }
}

.brand-stat-item {
    display: flex;
    flex-direction: column;
}

    .brand-stat-item strong {
        font-size: 1.6rem;
        color: var(--brand-cyan-soft);
        font-weight: 800;
    }

    .brand-stat-item span {
        font-size: 0.82rem;
        color: #9db4c7;
    }

/* ---------- آیکون‌های شناور تزئینی ---------- */
.floating-icons {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

    .floating-icons i {
        position: absolute;
        color: rgba(255, 255, 255, 0.08);
        font-size: 3.5rem;
        animation: float-icon 8s ease-in-out infinite;
    }

.icon-a {
    top: 12%;
    left: 12%;
    animation-delay: 0s;
}

.icon-b {
    top: 68%;
    left: 6%;
    font-size: 2.6rem;
    animation-delay: -2s;
}

.icon-c {
    top: 20%;
    left: 82%;
    font-size: 3rem;
    animation-delay: -4s;
}

.icon-d {
    top: 75%;
    left: 78%;
    font-size: 2.8rem;
    animation-delay: -6s;
}

@keyframes float-icon {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-22px) rotate(8deg);
    }
}

/* ---------- پنل فرم ---------- */
.form-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
}

/* ---------- کارت شیشه‌ای ---------- */
.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-radius: 22px;
    padding: 44px 36px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    animation: card-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.15s;
}

@keyframes card-rise {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon-ring {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-cyan), #2c8fc9);
    box-shadow: 0 0 0 8px rgba(71, 178, 228, 0.12);
    animation: ring-pulse 3s ease-in-out infinite;
}

@keyframes ring-pulse {
    0%, 100% {
        box-shadow: 0 0 0 8px rgba(71, 178, 228, 0.12);
    }

    50% {
        box-shadow: 0 0 0 14px rgba(71, 178, 228, 0.05);
    }
}

.login-card-header h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.login-card-header p {
    color: #b7cbdb;
    font-size: 0.88rem;
    margin: 0;
}

/* ---------- فیلدهای فرم با لیبل شناور ---------- */
.form-group.floating-group {
    position: relative;
    margin-bottom: 26px;
    opacity: 0;
    transform: translateY(14px);
    animation: field-in 0.5s ease forwards;
}

.login-form .form-group:nth-of-type(1) {
    animation-delay: 0.35s;
}

.login-form .form-group:nth-of-type(2) {
    animation-delay: 0.45s;
}

@keyframes field-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating-group .form-control {
    width: 100%;
    height: 54px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 12px;
    color: #fff;
    padding: 22px 44px 8px 44px;
    font-size: 0.95rem;
    outline: none;
    transition: background 0.25s ease;
}

    .floating-group .form-control::placeholder {
        color: transparent;
    }

.floating-group label {
    position: absolute;
    top: 50%;
    right: 44px;
    transform: translateY(-50%);
    color: #9db4c7;
    font-size: 0.9rem;
    pointer-events: none;
    transition: all 0.2s ease;
}

.floating-group .form-control:focus + label,
.floating-group .form-control:not(:placeholder-shown) + label {
    top: 15px;
    right: 44px;
    font-size: 0.72rem;
    color: var(--brand-cyan-soft);
}

.field-icon {
    position: absolute;
    top: 27px;
    right: 16px;
    color: #7691a7;
    font-size: 1.05rem;
    transition: color 0.25s ease;
}

.floating-group .form-control:focus ~ .field-icon {
    color: var(--brand-cyan);
}

.field-underline {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-cyan), var(--brand-cyan-soft));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.floating-group .form-control:focus ~ .field-underline {
    width: 100%;
}

.toggle-password {
    position: absolute;
    top: 16px;
    left: 12px;
    background: none;
    border: none;
    color: #7691a7;
    font-size: 1rem;
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s ease;
}

    .toggle-password:hover {
        color: var(--brand-cyan);
    }

.field-error {
    color: #ff8a8a;
    font-size: 0.76rem;
    margin-top: 6px;
    min-height: 1em;
}

/* ---------- گزینه‌ها ---------- */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    font-size: 0.85rem;
    opacity: 0;
    animation: field-in 0.5s ease forwards;
    animation-delay: 0.55s;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b7cbdb;
    cursor: pointer;
}

    .remember-me input {
        display: none;
    }

.checkbox-visual {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid #7691a7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: transparent;
    transition: all 0.2s ease;
}

.remember-me input:checked + .checkbox-visual {
    background: var(--brand-cyan);
    border-color: var(--brand-cyan);
    color: #fff;
}

.forgot-link {
    color: var(--brand-cyan-soft);
    text-decoration: none;
}

    .forgot-link:hover {
        text-decoration: underline;
    }

/* ---------- دکمه ورود ---------- */
.btn-login {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--brand-cyan), #2c8fc9);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    opacity: 0;
    animation: field-in 0.5s ease forwards;
    animation-delay: 0.65s;
}

    .btn-login:hover:not(:disabled) {
        transform: translateY(-3px);
        box-shadow: 0 14px 30px rgba(71, 178, 228, 0.45);
    }

    .btn-login:active:not(:disabled) {
        transform: translateY(0);
    }

.btn-arrow {
    transition: transform 0.25s ease;
}

.btn-login:hover .btn-arrow {
    transform: translateX(-4px);
}

.btn-login:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: spin-loader 0.7s linear infinite;
}

.btn-login.loading .btn-spinner {
    display: inline-block;
}

.btn-login.loading .btn-arrow {
    display: none;
}

@keyframes spin-loader {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- پیام‌های وضعیت ---------- */
.login-message {
    display: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-top: 16px;
    text-align: center;
    animation: message-slide 0.3s ease;
}

    .login-message.show {
        display: block;
    }

.success-message {
    background: rgba(46, 204, 113, 0.15);
    color: #6fe3a3;
}

.error-message {
    background: rgba(255, 90, 90, 0.15);
    color: #ff8a8a;
}

@keyframes message-slide {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- جداکننده ---------- */
.login-divider {
    position: relative;
    text-align: center;
    margin: 22px 0 16px;
    color: #7691a7;
    font-size: 0.8rem;
}

    .login-divider::before,
    .login-divider::after {
        content: "";
        position: absolute;
        top: 50%;
        width: 42%;
        height: 1px;
        background: rgba(255, 255, 255, 0.12);
    }

    .login-divider::before {
        right: 0;
    }

    .login-divider::after {
        left: 0;
    }

.signup-hint {
    text-align: center;
    font-size: 0.87rem;
    color: #b7cbdb;
    margin: 0;
}

    .signup-hint a {
        color: var(--brand-cyan-soft);
        font-weight: 700;
        text-decoration: none;
    }

        .signup-hint a:hover {
            text-decoration: underline;
        }

/* ---------- بازگشت به خانه ---------- */
.back-home {
    margin-top: 22px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #9db4c7;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

    .back-home:hover {
        color: var(--brand-cyan-soft);
    }

/* ---------- کاهش انیمیشن برای دسترسی‌پذیری ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
