/* === 기본 스타일 (body, h2 등) === */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #6c757d;
    --secondary-hover: #5a6268;
    --error-color: #dc3545;
    --bg-color: #f8f9fa;
    --text-color: #343a40;
    --border-color: #ced4da;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.5;
}

h2 {
    color: #333;
    margin-bottom: 1.5rem; /* 제목 아래 여백 */
    font-weight: 600; /* 제목 굵기 */
}

/* === 폼 컨테이너 공통 스타일 (로그인, 회원가입 등) === */
.form-container {
    width: 95%;
    max-width: 500px;
    margin: 40px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* 회원가입 컨테이너는 조금 더 넓게 */
.signup-container {
    max-width: 450px;
}

/* === 입력 필드 그룹 스타일 === */
.input-group {
    margin-bottom: 1rem; /* 그룹 간 여백 */
    text-align: left; /* 레이블과 입력 필드는 왼쪽 정렬 */
}

.input-group label {
    display: block; /* 레이블을 블록 요소로 만들어 줄바꿈 */
    margin-bottom: 0.5rem; /* 레이블과 입력 필드 사이 여백 */
    font-weight: 500; /* 레이블 굵기 */
    color: #495057; /* 레이블 색상 */
    font-size: 0.9rem; /* 레이블 글자 크기 */
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group input[type="email"],
.input-group select {
    width: 100%; /* 너비 100% */
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* 읽기 전용 필드 스타일 */
.input-group input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* 입력 필드 포커스 시 스타일 */
.input-group input[type="text"]:focus,
.input-group input[type="password"]:focus,
.input-group input[type="email"]:focus {
    border-color: #80bdff; /* 포커스 시 테두리 색상 */
    outline: 0; /* 기본 아웃라인 제거 */
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); /* 포커스 시 그림자 효과 */
}

/* === 에러 메시지 스타일 === */
.error-message {
    color: #dc3545; /* 에러 메시지 색상 (빨간색 계열) */
    font-size: 0.85em; /* 글자 크기 약간 작게 */
    margin-bottom: 1rem; /* 아래쪽 여백 */
    min-height: 1.2em; /* 메시지 없을 때도 공간 차지하도록 */
    text-align: left; /* 왼쪽 정렬 */
    font-weight: 500;
}

/* === 버튼과 함께 있는 입력 필드 그룹 === */
.input-group.with-button {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.input-group.with-button input {
    flex-grow: 1;
}

/* === 버튼 스타일 === */
.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* 보조 버튼 스타일 (우편번호 찾기, 중복 확인 등) */
.btn-secondary {
    padding: 0 15px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

/* 버튼 영역 */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group button {
    flex: 1;
}

/* === 회원가입 링크 스타일 === */
.signup-link {
    margin-top: 1.5rem; /* 위쪽 여백 */
    font-size: 0.9em;
    color: #6c757d; /* 약간 연한 회색 */
}

.signup-link a {
    color: #007bff; /* 링크 색상 */
    text-decoration: none; /* 밑줄 제거 */
    font-weight: 500;
}

.signup-link a:hover {
    text-decoration: underline; /* 호버 시 밑줄 */
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .form-container {
        margin: 20px auto;
        padding: 20px;
        border-radius: 0;
        box-shadow: none;
    }
}

/* === 리스트 및 카드 공통 스타일 === */
.list-container {
    width: 95%;
    max-width: 600px;
    margin: 20px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.list-header h2 {
    margin-bottom: 0;
    font-size: 1.25rem;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--primary-color);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
}

.card:active {
    transform: scale(0.98);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-color);
}

.card-info {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    background-color: #eef6ff;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.8rem;
}
