/* 登录页样式 - 凡智·任务课堂 */
/* 沿用深空蓝、星光金主色 */

.login-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--deep-space-blue) 0%, #1a3a6e 50%, var(--light-blue) 100%);
}

.login-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.login-header-brand .logo-img {
    max-width: 80px;
    height: auto;
    flex-shrink: 0;
}

.login-platform-name {
    font-size: 28px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.02em;
}

.login-header h1 {
    margin-bottom: 8px;
}

.login-header .logo-img {
    max-width: 80px;
    margin-bottom: 0;
}

.login-header h1 {
    font-size: 28px;
    color: white;
    margin-bottom: 8px;
}

.login-header .logo-english {
    font-size: 18px;
    color: var(--starlight-gold);
    margin-left: 8px;
}

.login-header p {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
}

.login-membership-teaser {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.88);
    margin: 12px 0 0;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.login-membership-teaser a {
    color: var(--starlight-gold);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.login-membership-teaser a:hover {
    color: #fff;
}

.login-iam-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
    margin: 10px auto 0;
    max-width: 480px;
    line-height: 1.5;
}

.login-iam-hint code {
    background: rgba(255, 255, 255, 0.15);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.login-iam-hint.is-online {
    color: #b8f5c8;
}

.login-iam-hint.is-offline {
    color: #ffd0a8;
}

.login-api-error {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff1f0;
    border: 1px solid #ffa39e;
    color: #a8071a;
    font-size: 13px;
    line-height: 1.5;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
}

.login-tabs {
    display: flex;
    border-bottom: 2px solid var(--light-gray);
}

.login-tab {
    flex: 1;
    padding: 16px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-gray);
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-tab.active {
    background: white;
    color: var(--deep-space-blue);
    border-bottom: 3px solid var(--starlight-gold);
    margin-bottom: -2px;
}

.login-tab:hover:not(.active) {
    background: #eef1f5;
    color: var(--deep-space-blue);
}

.role-select-section {
    padding: 28px 32px;
    border-bottom: 1px solid #eee;
}

.role-select-section h3 {
    font-size: 15px;
    color: var(--deep-space-blue);
    margin-bottom: 16px;
}

.role-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

/* 覆盖上方 display:flex，否则 HTML hidden 属性无法隐藏选项 */
.role-option[hidden] {
    display: none !important;
}

.role-option:hover {
    border-color: var(--light-blue);
    background: rgba(62, 146, 204, 0.06);
}

.role-option.selected {
    border-color: var(--starlight-gold);
    background: rgba(255, 215, 0, 0.08);
}

.role-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.role-option-icon svg {
    width: 22px;
    height: 22px;
}

.role-option-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.role-option.selected .role-option-text {
    color: var(--deep-space-blue);
}

.login-form-section {
    padding: 28px 32px 32px;
}

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

.login-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.25s ease;
}

.login-form input:focus {
    outline: none;
    border-color: var(--light-blue);
}

.login-form .login-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--starlight-gold) 0%, #e6c200 100%);
    color: var(--deep-space-blue);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.login-form .login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.login-footer-links {
    text-align: center;
    margin-top: 20px;
}

.login-footer-links a {
    color: var(--light-blue);
    text-decoration: none;
    font-size: 13px;
    margin: 0 12px;
}

.login-footer-links a:hover {
    text-decoration: underline;
}

.login-link-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0 12px;
    color: var(--light-blue);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.login-link-btn:hover {
    text-decoration: underline;
}

/* 短信登录演示 */
.login-sms-panel {
    padding-top: 0;
}

.login-sms-demo-hint {
    font-size: 12px;
    color: var(--dark-gray);
    line-height: 1.5;
    margin: 0 0 16px;
    padding: 10px 12px;
    background: #f5f7fa;
    border-radius: 8px;
    border-left: 3px solid var(--starlight-gold);
}

.login-sms-code-wrap {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.login-sms-code-wrap input {
    flex: 1;
    min-width: 0;
}

.login-sms-send-btn {
    flex-shrink: 0;
    padding: 12px 14px;
    border: 2px solid var(--light-blue);
    border-radius: 8px;
    background: white;
    color: var(--deep-space-blue);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.login-sms-send-btn:hover:not(:disabled) {
    background: rgba(62, 146, 204, 0.08);
}

.login-sms-send-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.login-sms-send-hint {
    display: block;
    font-size: 12px;
    color: #2e7d32;
    margin-top: 6px;
    min-height: 1.2em;
}

/* 忘记密码弹层 */
.login-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-modal[hidden] {
    display: none !important;
}

.login-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 36, 99, 0.45);
    backdrop-filter: blur(2px);
}

.login-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    padding: 28px 28px 24px;
}

.login-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    border-radius: 8px;
}

.login-modal__close:hover {
    background: #f0f0f0;
    color: #333;
}

.login-modal__title {
    margin: 0 32px 8px 0;
    font-size: 18px;
    color: var(--deep-space-blue);
}

.login-modal__lead {
    font-size: 13px;
    color: var(--dark-gray);
    line-height: 1.5;
    margin: 0 0 20px;
}

.login-modal__dialog .login-form {
    margin-bottom: 12px;
}

.login-modal__result {
    font-size: 13px;
    color: #2e7d32;
    margin: 0 0 16px;
    min-height: 0;
}

.login-modal__result:empty {
    display: none;
}

.btn-dismiss-modal {
    width: 100%;
    padding: 10px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-gray);
    cursor: pointer;
    font-family: inherit;
}

.btn-dismiss-modal:hover {
    border-color: var(--light-blue);
    color: var(--deep-space-blue);
}

/* 注册表单 */
.register-form-section .form-hint {
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.register-role-hint {
    font-size: 13px;
    color: var(--dark-gray);
    margin: 4px 0 16px;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 14px;
    margin-top: 24px;
    transition: color 0.25s ease;
}

.back-home:hover {
    color: var(--starlight-gold);
}

/* 登录页底部版权（与页面统一背景，不单独设色） */
.login-footer {
    padding: 32px 0 24px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
}

.login-footer .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 20px;
}

.login-footer-brand {
    text-align: center;
    margin-bottom: 16px;
}

.login-footer-brand strong {
    display: block;
    font-size: 16px;
    color: white;
    margin-bottom: 4px;
}

.login-footer-brand span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.login-footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 16px;
    margin-top: 0;
}

.login-footer .copyright {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    margin: 0;
}

@media (max-width: 600px) {
    .role-options {
        grid-template-columns: 1fr;
    }
    .login-card {
        margin: 0 12px;
    }
    .login-form-section,
    .role-select-section {
        padding: 20px 20px 24px;
    }
}
