/* ==========================================
   Modern Login Page - Override for ThinkCMF
   Preserves Bootstrap 3 framework, overrides visuals
   ========================================== */

/* ---- Full-screen Background ---- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
.login-page {
    min-height: 100vh;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1628 0%, #1a365d 50%, #165dff 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}
.login-page::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(22,93,255,0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.login-page::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.login-page .bg-dots {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* ---- Login Card ---- */
.login-card {
    position: relative;
    z-index: 1;
    width: 420px;
    max-width: 100%;
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: loginFadeIn 0.6s ease-out;
}
@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Card Header ---- */
.login-header {
    text-align: center;
    margin-bottom: 28px;
}
.login-header .login-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 14px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(22,93,255,0.2);
}
.login-header .login-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a365d;
    margin: 0 0 4px;
    line-height: 1.3;
}
.login-header .login-subtitle {
    font-size: 14px;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

/* ---- Form Groups ---- */
.login-card .form-group {
    margin-bottom: 18px;
}

/* ---- Input Groups (Bootstrap 3 override) ---- */
.login-card .input-group {
    width: 100% !important;
    border-collapse: separate;
    display: table;
}
.login-card .input-group .input-group-addon {
    display: table-cell;
    width: 46px !important;
    padding: 0 !important;
    text-align: center;
    vertical-align: middle;
    background: #f0f2f5 !important;
    border: 2px solid transparent !important;
    border-right: none !important;
    border-radius: 10px 0 0 10px !important;
    font-size: 16px;
    color: #aaa;
    transition: all 0.3s ease;
}
.login-card .input-group .form-control:focus ~ .input-group-addon,
.login-card .input-group:focus-within .input-group-addon {
    background: #fff !important;
    border-color: #165dff !important;
    color: #165dff;
}
.login-card .input-group .form-control {
    display: table-cell;
    float: none !important;
    height: 48px;
    padding: 10px 14px;
    font-size: 15px;
    color: #333;
    background: #f7f8fa !important;
    border: 2px solid transparent !important;
    border-left: none !important;
    border-radius: 0 10px 10px 0 !important;
    box-shadow: none !important;
    transition: all 0.3s ease;
}
.login-card .input-group .form-control:focus {
    background: #fff !important;
    border-color: #165dff !important;
    box-shadow: none !important;
    outline: none;
}
.login-card .input-group .form-control::-moz-placeholder { color: #aaa; }
.login-card .input-group .form-control:-ms-input-placeholder { color: #aaa; }
.login-card .input-group .form-control::-webkit-input-placeholder { color: #aaa; }

/* ---- Captcha Row (flex layout) ---- */
.login-card .form-group .captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.login-card .form-group .captcha-row .form-control {
    flex: 1;
    min-width: 0;
    border-radius: 10px !important;
}
.login-card .form-group .captcha-row captcha,
.login-card .form-group .captcha-row img.captcha {
    flex-shrink: 0;
    position: static !important;
    right: auto;
    top: auto;
    height: 38px;
    border-radius: 6px;
    cursor: pointer;
}

/* ---- Buttons ---- */
.login-card .btn-primary {
    height: 48px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #165dff, #1a365d) !important;
    border: none !important;
    border-radius: 10px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 2px;
    text-shadow: none !important;
    box-shadow: none !important;
}
.login-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(22,93,255,0.35) !important;
    background: linear-gradient(135deg, #165dff, #1a365d) !important;
}
.login-card .btn-primary:active {
    transform: translateY(0);
}

/* ---- Tab Navigation (for dual-mode) ---- */
.login-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: #f0f2f5;
    border-radius: 10px;
    padding: 3px;
    border: none;
}
.login-tabs .tab-btn {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}
.login-tabs .tab-btn:hover { color: #333; }
.login-tabs .tab-btn.active {
    background: #fff;
    color: #165dff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
/* Override Bootstrap nav-tabs if used */
.login-card .nav-tabs {
    border-bottom: none !important;
    background: #f0f2f5;
    border-radius: 10px;
    padding: 3px;
}
.login-card .nav-tabs > li {
    float: none;
    display: inline-block;
    margin-bottom: 0 !important;
}
.login-card .nav-tabs > li > a {
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    background: transparent;
    margin: 0 !important;
}
.login-card .nav-tabs > li.active > a {
    background: #fff !important;
    color: #165dff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ---- Verification code row ---- */
.verify-row {
    display: flex;
    gap: 10px;
}
.verify-row .input-group {
    flex: 1;
}
.verify-btn {
    flex-shrink: 0;
    padding: 0 16px;
    height: 48px;
    font-size: 13px;
    font-weight: 500;
    color: #165dff;
    background: #e8f0fe;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}
.verify-btn:hover { background: #d0dfff; }
.verify-btn:disabled {
    color: #999;
    background: #f0f0f0;
    cursor: not-allowed;
}

/* ---- Footer ---- */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.login-footer p {
    font-size: 12px;
    color: #aaa;
    margin: 0;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px 24px;
    }
}
