/* ===================================
   CarryBear - 로그인 / 회원가입 스타일
   css/auth.css
   =================================== */

/* 인증 페이지 공통 컨테이너 */
.auth-section {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 40%, #f9fafb 100%);
}

/* 카드 박스 */
.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-orange));
}

/* 타이틀 영역 */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    text-decoration: none;
}

.auth-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.auth-logo span {
    font-family: var(--font-secondary);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.375rem;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* 폼 그룹 */
.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.auth-form .form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--gray-800);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    outline: none;
}

.auth-form .form-control:focus {
    border-color: var(--primary-blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(10, 126, 164, 0.12);
}

.auth-form .form-control.is-invalid {
    border-color: var(--error);
    background: #fff5f5;
}

.auth-form .form-control.is-valid {
    border-color: var(--success);
}

/* 에러/힌트 메시지 */
.field-message {
    font-size: 0.78rem;
    margin-top: 0.3rem;
    min-height: 1rem;
}

.field-message.error {
    color: var(--error);
}

.field-message.success {
    color: var(--success);
}

/* 비밀번호 입력 래퍼 */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper .form-control {
    width: 100%;
    display: block;
    padding-right: 2.8rem;
}

.toggle-pw {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 1rem;
    line-height: 1;
    padding: 0.2rem;
    transition: color var(--transition-fast);
}

.toggle-pw:hover {
    color: var(--primary-blue);
}

/* 국적 선택 */
.nationality-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.nationality-option {
    display: none;
}

.nationality-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.5rem 0.25rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
    background: var(--gray-50);
    transition: all var(--transition-fast);
    text-align: center;
}

.nationality-label .flag {
    font-size: 1.4rem;
}

.nationality-option:checked + .nationality-label {
    border-color: var(--primary-blue);
    background: #e0f2fe;
    color: var(--primary-blue);
    font-weight: 700;
}

/* 체크박스 */
.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    cursor: pointer;
}

.auth-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 0.1rem;
    accent-color: var(--primary-blue);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-checkbox a {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* 제출 버튼 */
.btn-auth {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
}

.btn-auth-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-auth-primary:hover:not(:disabled) {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 126, 164, 0.35);
}

.btn-auth-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 구분선 */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--gray-400);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* 하단 링크 */
.auth-footer-link {
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 1.5rem;
}

.auth-footer-link a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* 알림 메시지 박스 */
.auth-alert {
    display: none;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.auth-alert.show {
    display: block;
}

.auth-alert.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.auth-alert.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* 마이페이지 */
.mypage-section {
    min-height: calc(100vh - 80px);
    padding: 3rem 1.5rem;
    background: var(--gray-50);
}

.mypage-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.mypage-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--primary-blue);
}

.mypage-info-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

.mypage-info-row:last-child {
    border-bottom: none;
}

.mypage-info-label {
    width: 110px;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--gray-500);
}

.mypage-info-value {
    color: var(--gray-800);
}

.mypage-container {
    max-width: 860px;
    margin: 0 auto;
}

.mypage-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.reservation-history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reservation-history-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem;
    background: var(--white);
}

.reservation-history-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.reservation-history-no {
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
}

.reservation-history-date {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: var(--gray-500);
}

.reservation-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-pending {
    background: #eef2ff;
    color: #4f46e5;
}

.status-confirmed {
    background: #ecfdf3;
    color: #15803d;
}

.status-transit {
    background: #ecfeff;
    color: #0e7490;
}

.status-completed {
    background: #eff6ff;
    color: #1d4ed8;
}

.status-cancelled {
    background: #fef2f2;
    color: #b91c1c;
}

.reservation-history-grid {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.reservation-history-row {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 0.5rem;
    align-items: start;
    font-size: 0.9rem;
}

.reservation-history-row .label {
    color: var(--gray-500);
    font-weight: 600;
}

.reservation-history-row .value {
    color: var(--gray-800);
    word-break: break-word;
}

.reservation-history-row.total-row .value {
    color: var(--primary-blue);
    font-weight: 700;
}

.mypage-empty-box {
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    text-align: center;
}

.mypage-empty-box p {
    margin-bottom: 0.9rem;
    color: var(--gray-600);
}

.mypage-primary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.mypage-primary-actions .btn,
.mypage-secondary-actions .btn {
    width: 100%;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.mypage-primary-actions .btn-outline,
.mypage-secondary-actions .btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.mypage-primary-actions .btn-outline:hover,
.mypage-secondary-actions .btn-outline:hover {
    background: var(--primary-blue);
    color: var(--white);
}

.mypage-logout-btn {
    background: transparent;
    color: var(--error);
    border: 2px solid var(--error);
}

.mypage-logout-btn:hover {
    background: var(--error);
    color: var(--white);
}

.mypage-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

@media (max-width: 768px) {
    .auth-section {
        align-items: flex-start;
        padding: 7.5rem 1rem 2rem;
    }

    .mypage-section {
        padding: 7.5rem 1rem 2rem;
    }

    .reservation-history-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 반응형 */
@media (max-width: 540px) {
    .auth-card {
        padding: 2rem 1.25rem;
    }

    .auth-title {
        font-size: 1.35rem;
    }

    .nationality-group {
        grid-template-columns: repeat(2, 1fr);
    }

    .mypage-primary-actions,
    .mypage-secondary-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
