/* ===== Login Page ===== */
.login-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
    position: relative;
    z-index: 1;
}

.login-card {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
}

.login-card-glow {
    position: absolute;
    inset: -2px;
    background: var(--gradient);
    border-radius: 26px;
    filter: blur(20px);
    opacity: 0.15;
    z-index: -1;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99,102,241,0.1);
    border-radius: 50%;
    margin: 0 auto 20px;
}

.login-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-light);
    font-size: 14px;
}

/* ===== Login Tabs ===== */
.login-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.login-tab:hover {
    color: var(--text);
}

.login-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== Form ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.input-prefix {
    padding: 0 12px 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    border-right: 1px solid var(--border);
    line-height: 48px;
}

.form-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    min-width: 0;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.code-wrapper .form-input {
    padding-right: 8px;
}

.form-error {
    font-size: 12px;
    color: #ef4444;
    min-height: 16px;
}

/* ===== Send Code Button ===== */
.btn-send-code {
    flex-shrink: 0;
    padding: 8px 16px;
    margin: 4px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: var(--gradient);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-send-code:hover:not(:disabled) {
    background: var(--gradient-hover);
    transform: scale(1.02);
}

.btn-send-code:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-send-code.counting {
    background: var(--border);
    color: var(--text-muted);
}

/* ===== Checkbox ===== */
.form-agreement {
    margin-top: -4px;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-light);
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.2s ease;
    position: relative;
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--gradient);
    border-color: var(--primary);
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

/* ===== Login Button ===== */
.btn-login {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

.btn-login:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-light);
}

/* ===== Login Alert ===== */
.login-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    animation: fadeInUp 0.3s ease;
}

.login-alert.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.login-alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* ===== Verify Modal ===== */
.verify-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.verify-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.verify-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.verify-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    animation: slideUp 0.3s ease;
}

.verify-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.verify-close:hover {
    background: var(--border);
}

.verify-header {
    text-align: center;
    margin-bottom: 20px;
}

.verify-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(16,185,129,0.1);
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    margin-bottom: 12px;
}

.verify-title {
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.verify-desc {
    font-size: 13px;
    color: var(--text-light);
}

/* ===== Prompt ===== */
.verify-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(99,102,241,0.06);
    border-radius: 10px;
    margin-bottom: 16px;
}

.prompt-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.prompt-chars {
    display: flex;
    gap: 6px;
}

.prompt-char {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gradient);
    color: white;
    font-size: 16px;
    font-weight: 700;
    border-radius: 6px;
}

/* ===== Verify Area ===== */
.verify-area {
    position: relative;
    width: 100%;
    height: 240px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border);
    margin-bottom: 16px;
    cursor: crosshair;
    user-select: none;
}

.verify-area-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, #f0f0ff 0%, #e8f4f8 50%, #fef0f5 100%);
    opacity: 0.8;
}

.verify-char {
    position: absolute;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    padding: 4px;
}

.verify-char:hover {
    transform: scale(1.2);
}

.verify-char.clicked {
    color: white !important;
    text-shadow: none;
}

.verify-char .char-marker {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: var(--gradient);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(99,102,241,0.4);
}

/* ===== Selected ===== */
.verify-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 16px;
    min-height: 44px;
}

.selected-label {
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.selected-chars {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.selected-char-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--gradient);
    color: white;
    font-size: 14px;
    font-weight: 700;
    border-radius: 6px;
    animation: fadeInUp 0.2s ease;
}

/* ===== Verify Actions ===== */
.verify-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.verify-refresh {
    font-size: 13px;
}

.verify-actions .btn-primary {
    font-size: 13px;
}

.verify-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== Verify Result ===== */
.verify-result {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
    min-height: 20px;
    transition: all 0.3s ease;
}

.verify-result.success {
    color: var(--success);
}

.verify-result.error {
    color: #ef4444;
}

/* ===== Success Modal ===== */
.success-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.success-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.success-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 48px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.success-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16,185,129,0.1);
    border-radius: 50%;
    margin: 0 auto 20px;
}

.success-icon svg {
    width: 36px;
    height: 36px;
    color: var(--success);
}

.success-content h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.success-content p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.success-spinner {
    display: flex;
    justify-content: center;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }
    .verify-content {
        padding: 24px 20px;
    }
    .verify-area {
        height: 200px;
    }
}
