/* ============================================
   JCO IoT Platform - Login Page Styles
   ============================================ */

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

/* ---------- Base ---------- */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #0a0e27;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: #fff;
    position: relative;
}

/* ---------- Animated Background ---------- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    z-index: 0;
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0%   { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ---------- Floating Shapes ---------- */
.bg-shapes {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: floatShape 20s ease-in-out infinite;
}

.shape-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(37,99,235,0.5), transparent);
    top: -150px; left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(6,182,212,0.4), transparent);
    bottom: -120px; right: -80px;
    animation-delay: -5s;
    animation-duration: 25s;
}

.shape-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(99,102,241,0.4), transparent);
    top: 40%; right: -60px;
    animation-delay: -10s;
    animation-duration: 18s;
}

.shape-4 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(14,165,233,0.3), transparent);
    bottom: 30%; left: -100px;
    animation-delay: -15s;
    animation-duration: 22s;
}

.shape-5 {
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(59,130,246,0.35), transparent);
    top: 60%; left: 50%;
    animation-delay: -3s;
    animation-duration: 16s;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(30px, -40px) scale(1.1); }
    50%      { transform: translate(-20px, 20px) scale(0.9); }
    75%      { transform: translate(-30px, -15px) scale(1.05); }
}

/* ---------- Particles ---------- */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0%   { transform: translateY(0) scale(1);   opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-100vh) scale(0); opacity: 0; }
}

/* ---------- Login Container ---------- */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 0 20px;
    animation: fadeInUp 0.8s ease-out;
}

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

/* ---------- Login Card ---------- */
.login-wrapper {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    padding: 44px 40px 36px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 80px rgba(37, 99, 235, 0.08);
}

/* ---------- Header ---------- */
.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(6, 182, 212, 0.2));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(37, 99, 235, 0.25);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
}

.logo-icon i {
    font-size: 32px;
    color: #38bdf8;
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.5));
}

.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header .subtitle {
    font-size: 13px;
    color: rgba(148, 163, 184, 0.7);
    letter-spacing: 4px;
    margin-bottom: 4px;
}

.login-header .notification {
    display: block;
    min-height: 24px;
    line-height: 24px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
    color: #f87171;
}

/* ---------- Form ---------- */
.login-form .form-group {
    margin-bottom: 20px;
}

/* Input with Icon */
.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    font-size: 15px;
    color: rgba(148, 163, 184, 0.5);
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 2;
}

.input-icon-wrapper:focus-within .input-icon {
    color: #38bdf8;
}

.input-icon-wrapper input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #e2e8f0;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    outline: none;
}

.input-icon-wrapper input:focus {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 0 0 3px rgba(56, 189, 248, 0.1),
        0 0 20px rgba(56, 189, 248, 0.06);
}

.input-icon-wrapper input::placeholder {
    color: rgba(148, 163, 184, 0.3);
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: 14px;
    cursor: pointer;
    color: rgba(148, 163, 184, 0.4);
    transition: color 0.3s ease;
    z-index: 2;
    padding: 4px;
}

.toggle-password:hover {
    color: #38bdf8;
}

/* Captcha */
.captcha-group {
    margin-bottom: 28px !important;
}

.captcha-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.captcha-input-wrap {
    flex: 1;
}

.captcha-image {
    flex-shrink: 0;
    width: 140px;
    height: 46px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4f8;
    transition: all 0.3s ease;
    position: relative;
}

.captcha-image:hover {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
}

.captcha-image img {
    display: block;
    pointer-events: none;
}

/* Click ripple */
.captcha-image::after {
    content: '点击刷新';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #94a3b8;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.captcha-image:hover::after {
    opacity: 1;
}

/* ---------- Login Button ---------- */
.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 28px rgba(37, 99, 235, 0.35),
        0 0 40px rgba(6, 182, 212, 0.15);
}

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

.login-btn:active {
    transform: translateY(0) scale(0.98);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-btn .fa-spinner {
    margin-right: 6px;
}

/* ---------- Footer ---------- */
.login-footer {
    text-align: center;
    margin-top: 32px;
}

.footer-divider {
    width: 40px;
    height: 2px;
    margin: 0 auto 16px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.3), transparent);
    border-radius: 1px;
}

.login-footer p {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.4);
    letter-spacing: 1px;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .login-wrapper {
        padding: 32px 24px 28px;
        border-radius: 16px;
    }

    .login-header h1 {
        font-size: 22px;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    .logo-icon i {
        font-size: 26px;
    }

    .captcha-row {
        flex-direction: column;
        gap: 10px;
    }

    .captcha-image {
        width: 100%;
        height: 44px;
    }

    .login-btn {
        letter-spacing: 4px;
    }
}
