/* Auth Pages Common Styling */
.login__area,
.register__area {
    background-color: #f8f9fa;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    margin-top: 60px;
}

.login__form,
.register__form {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 40px;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    border: 1px solid #eef2f6;
}

.register__header {
    text-align: center;
    margin-bottom: 35px;
}

.register__title {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.register__subtitle {
    color: #7f8c8d;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Form Elements */
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form__row {
    display: flex;
    gap: 15px;
    margin-bottom: 0;
}

.form__group {
    margin-bottom: 24px;
    position: relative;
    flex: 1;
}

/* 标签和图标在同一行的样式 */
.form__label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    gap: 8px;
}

.form__label i {
    color: #3498db;
    font-size: 14px;
}

.input__container {
    position: relative;
    display: flex;
    align-items: center;
}

.input__icon {
    position: absolute;
    left: 16px;
    color: #95a5a6;
    font-size: 16px;
    z-index: 2;
}

.form__input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e8ecef;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #fafbfc;
    line-height: 1.5;
    font-family: inherit;
}

.form__input:focus {
    outline: none;
    border-color: #3498db;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form__input::placeholder {
    color: #a0a4a8;
    font-size: 14px;
}

/* Password toggle button */
.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.3s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: #3498db;
}

/* Role Selection - Enhanced */
.role-selection {
    margin: 25px 0;
    padding: 20px;
    background-color: #f8fafc;
    border-radius: 10px;
    border: 1px solid #eef2f6;
}

.role-selection__label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    text-align: center;
}

.role-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.role-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 16px 12px;
    border: 2px solid #e8ecef;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    min-height: 80px;
}

.role-btn:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.role-btn input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Enhanced checked state for role buttons */
.role-btn input[type="radio"]:checked + .role-icon + .role-name {
    color: #3498db;
    font-weight: 600;
}

.role-btn input[type="radio"]:checked ~ .role-icon {
    color: #3498db;
    transform: scale(1.1);
}

.role-btn input[type="radio"]:checked ~ .role-name {
    color: #3498db;
    font-weight: 600;
}

.role-btn.selected {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.05);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.role-icon {
    font-size: 24px;
    margin-bottom: 8px;
    color: #7f8c8d;
    transition: all 0.3s ease;
}

.role-name {
    font-size: 13px;
    font-weight: 500;
    color: #5a6c7d;
    transition: color 0.3s ease;
    text-align: center;
}

/* Terms and Conditions */
.terms {
    display: flex;
    align-items: flex-start;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 10px;
    border: 1px solid #eef2f6;
}

.terms input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.terms label {
    font-size: 14px;
    color: #5a6c7d;
    line-height: 1.4;
    cursor: pointer;
}

.terms a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.terms a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin: 10px 0 20px;
    font-family: inherit;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
    background: linear-gradient(135deg, #2980b9, #2471a3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loading {
    display: none;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .btn-loading {
    display: block;
}

/* Form Links */
.form__links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eef2f6;
}

.form__links p {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

.form__links a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: color 0.3s ease;
}

.form__links a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Form Options (Remember Me & Forgot Password) */
.form__options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox__container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #5a6c7d;
    user-select: none;
}

.checkbox__container input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3498db;
}

.checkmark {
    margin-left: 4px;
}

.forgot-password {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #2980b9;
    text-decoration: underline;
}

.forgot-password:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Error Messages */
.form__error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 6px;
    display: none;
    padding-left: 5px;
}

.form__group.error .form__error {
    display: block;
}

.form__group.error .form__input {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.error-message {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin: 15px 0;
    border-left: 4px solid #e74c3c;
    display: none;
}

.error-message.show {
    display: block;
}

/* Success Message */
.success-message {
    background-color: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin: 15px 0;
    border-left: 4px solid #27ae60;
    display: none;
}

.success-message.show {
    display: block;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    height: 4px;
    border-radius: 2px;
    background-color: #ecf0f1;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak {
    background-color: #e74c3c;
    width: 33%;
}

.strength-medium {
    background-color: #f39c12;
    width: 66%;
}

.strength-strong {
    background-color: #27ae60;
    width: 100%;
}

.strength-text {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 4px;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login__form,
    .register__form {
        padding: 30px 20px;
        margin: 0 15px;
    }

    .login__area,
    .register__area {
        padding: 40px 0;
        margin-top: 50px;
    }

    .form__row {
        flex-direction: column;
        gap: 0;
    }

    .role-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .role-btn {
        min-height: 70px;
        padding: 12px;
    }

    .register__title {
        font-size: 24px;
    }

    .register__subtitle {
        font-size: 15px;
    }

    .terms {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .login__form,
    .register__form {
        padding: 25px 15px;
        margin: 0 10px;
        border-radius: 12px;
    }

    .role-selection {
        padding: 15px;
    }

    .form__input {
        padding: 12px 16px 12px 44px;
        font-size: 14px;
    }

    .input__icon {
        left: 14px;
        font-size: 15px;
    }

    .submit-btn {
        padding: 14px;
        font-size: 15px;
    }
}

/* Animation for form elements */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.register__form {
    animation: slideIn 0.5s ease-out;
}

/* Focus states for accessibility */
.form__input:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.submit-btn:focus-visible {
    outline: 2px solid #2c3e50;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form__input {
        border-width: 3px;
    }
    
    .role-btn {
        border-width: 3px;
    }
    
    .submit-btn {
        border: 2px solid #2c3e50;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .form__input,
    .role-btn,
    .submit-btn {
        transition: none;
    }
    
    .register__form {
        animation: none;
    }
}

/* 弹窗动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.modal-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.modal-icon.error {
  color: #f44336;
}

.modal-icon.success {
  color: #4CAF50;
}

.modal-title {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 20px;
  font-weight: 600;
}

.modal-message {
  margin: 0 0 25px 0;
  color: #666;
  line-height: 1.5;
  font-size: 16px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-button {
  padding: 12px 30px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.modal-button.primary {
  background: #f44336;
  color: white;
}

.modal-button.primary:hover {
  background: #d32f2f;
}

.modal-button.secondary {
  background: #2196F3;
  color: white;
}

.modal-button.secondary:hover {
  background: #1976D2;
}