/* Auth Pages Styling (Login & Signup) */
:root {
  --primary-color: #4a69bd;
  --primary-dark: #3b5093;
  --primary-light: #eaf0fb;
  --success-color: #2ecc40;
  --error-color: #e74c3c;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e0e6ed;
  --bg-color: #f8fafc;
  --white: #ffffff;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
  --border-radius: 12px;
  --input-radius: 10px;
  --button-radius: 10px;
}

/* Base Styles */
body {
  font-family: 'Noto Sans KR', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  line-height: 1.6;
}

.site-brand-fixed {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
}

.site-brand-fixed a {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.site-brand-fixed .logo-image {
  height: 28px;
  width: auto;
}

.site-brand-fixed a:hover {
  color: var(--primary-dark);
}

.auth-container {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  padding: 40px;
  margin: 20px;
  position: relative;
  overflow: hidden;
}

.auth-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
}

.auth-container h2 {
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.8rem;
  font-weight: 600;
}

/* Form Styles */
form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.input-row-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #b0b8c1;
  display: flex;
  align-items: center;
  justify-content: center;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 15px 15px 15px 45px;
  border: 1px solid var(--border-color);
  border-radius: var(--input-radius);
  font-size: 1rem;
  transition: var(--transition);
  box-sizing: border-box;
  background-color: var(--bg-color);
}

input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 105, 189, 0.15);
}

.input-checkmark {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em;
  color: var(--success-color);
  display: none;
}

button[type="submit"] {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--button-radius);
  padding: 15px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 5px;
}

button[type="submit"]:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

/* Password Rules */
.password-rules {
  list-style-type: none;
  padding: 15px;
  margin: 0;
  background-color: var(--bg-color);
  border-radius: var(--input-radius);
  font-size: 0.9rem;
  color: var(--text-light);
  display: none;
}

.password-rules li {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.password-rules li:last-child {
  margin-bottom: 0;
}

.rule-icon {
  margin-right: 8px;
  display: inline-block;
}

/* Message Styles */
.email-msg,
.password-confirm-msg {
  font-size: 0.9rem;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  opacity: 0;
  transition: max-height 0.3s ease, margin 0.3s ease, opacity 0.3s ease;
  display: block;
  width: 100%;
}

.email-msg.show,
.password-confirm-msg.show {
  max-height: 50px;
  margin-top: 3px;
  margin-bottom: 3px;
  opacity: 1;
}

/* 비밀번호 확인 메시지 위치 명확화 */
.password-confirm-msg {
  position: relative;
  clear: both;
}

#signupMsg,
#loginMsg {
  font-size: 0.9rem;
  margin-top: 3px;
  min-height: 20px;
}

/* Divider */
.signup-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 8px 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  text-align: center;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-divider span {
  padding: 0 16px;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Social Login */
.social-login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
}

/* Terms Checkbox */
label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-light);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

/* Links */
.auth-link {
  text-align: center;
  margin-top: 15px;
  font-size: 0.95rem;
  color: var(--text-light);
}

.auth-link a,
label a {
  color: var(--primary-color);
  text-decoration: underline;
  transition: var(--transition);
}

.auth-link a:hover,
label a:hover {
  color: var(--primary-dark);
}

/* Modal Styles */
.terms-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}

.terms-modal-content {
  background-color: var(--white);
  margin: 5% auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terms-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
}

.terms-modal-header h3 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.3rem;
}

.terms-modal-close {
  color: var(--text-light);
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
}

.terms-modal-close:hover {
  color: var(--error-color);
}

.terms-modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.terms-content {
  padding: 25px;
}

.terms-content h4 {
  color: var(--primary-color);
  margin-top: 25px;
  margin-bottom: 15px;
}

.terms-content h5 {
  margin-top: 20px;
  margin-bottom: 10px;
}

.terms-content p, 
.terms-content li {
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text-color);
}

.terms-modal-footer {
  padding: 15px 25px;
  border-top: 1px solid var(--border-color);
  text-align: right;
}

.terms-modal-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--button-radius);
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.terms-modal-btn:hover {
  background-color: var(--primary-dark);
}

/* 반응형 디자인 모바일 쿼리 */
@media (max-width: 480px) {
  .auth-container {
    padding: 21px 0px;
    margin: 0px;
    box-shadow: none;
  }
  
  .site-brand-fixed {
    top: 15px;
    left: 15px;
  }
  
  .site-brand-fixed a {
    font-size: 1.5rem;
  }
  
  .auth-container h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
  }
  
  .input-icon {
    left: 34px;
  }
  
  input[type="email"],
  input[type="password"] {
    padding: 12px 12px 12px 50px;
    width: calc(100% - 40px);
    margin: 0 20px;
  }
  
  button[type="submit"] {
    width: calc(100% - 40px);
    margin: 5px 20px 0 20px;
  }
  
  .terms-modal-content {
    margin: 10% auto;
    width: 95%;
  }
}