/* 스피너 */
#spinner-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
#spinner-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.spinner-icon {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(0, 0, 0, 0.08);
  border-top-color: #0d6efd;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#spinner-overlay p {
  margin-top: 15px;
  font-weight: 600;
  color: #333;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center;
}

/* =========================
   SOCIAL BUTTON BASE
========================= */

.social-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 48px;

    font-weight: 600;
    text-decoration: none;

    gap: 0.5rem;

    padding-left: 2.5rem;  /* icon space */
    position: relative;

    transition: all .18s ease;
}

/* 공통 아이콘 영역 */
.social-btn::before{
    content: "";
    position: absolute;
    left: 1rem;

    width: 20px;
    height: 20px;

    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* hover */
.social-btn:hover{
    transform: translateY(-1px);
}

.social-btn:active{
    transform: translateY(0);
}

.social-btn.kakao{
    background-color: #FEE500;
    color: #3c1e1e;
}

.social-btn.kakao::before{
    background-image: url("/assets/img/ico-kakao.png");
}

.social-btn.naver{
    background-color: #03C75A;
    color: #fff;
}

.social-btn.naver::before{
    background-image: url("/assets/img/ico-naver.png");
}

.social-btn.google{
    background-color: #ffffff;
    color: #1f2937;
    border: 1px solid #dee2e6;
}

.social-btn.google::before{
    background-image: url("/assets/img/ico-google.png");
}

@media (max-width: 576px){
    .social-btn{
        min-height: 44px;
        font-size: 14px;
        padding-left: 2.3rem;
    }

    .social-btn::before{
        width: 18px;
        height: 18px;
        left: 0.9rem;
    }
}


/* form 오류 */
/* 에러 블록 전체 컨테이너 */
.error-msg-floating {
    position: absolute;
    z-index: 2147483647;

    min-width: 180px;
    max-width: min(92vw, 360px);

    padding: 11px 40px 11px 12px;

    border-radius: 12px;

    background: rgba(24,24,27,0.96);
    color: #fff;

    font-size: 13px;
    line-height: 1.5;

    box-shadow:
        0 10px 30px rgba(0,0,0,0.18),
        0 2px 10px rgba(0,0,0,0.08);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    pointer-events: auto;

    opacity: 0;
    transform: translateY(-4px);

    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.error-msg-floating.show {
    opacity: 1;
    transform: translateY(0);
}

.error-msg-floating::before {
    content: "";

    position: absolute;

    left: var(--arrow-left, 24px);
    top: -6px;

    width: 12px;
    height: 12px;

    background: rgba(24,24,27,0.96);

    transform: rotate(45deg);
}

.error-msg-floating .msg-text {
    display: block;
    word-break: keep-all;
    white-space: normal;
}

/* 닫기 버튼 */
.error-msg-close {
    position: absolute;

    top: 8px;
    right: 8px;

    width: 22px;
    height: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 999px;

    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.78);

    font-size: 11px;

    cursor: pointer;

    transition:
        background 140ms ease,
        color 140ms ease;
}

.error-msg-close:hover {
    background: rgba(255,255,255,0.16);
    color: #fff;
}

.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 0.2rem rgba(239,68,68,0.12) !important;
}

/**
 * 입력란 검증결과 데코레이션
 */
input.form-control {
    position: relative;
    padding-right: 2.4rem;
    transition: all 160ms ease;
}

/* VALID */
input.form-control.is-valid {
    box-shadow: 0 0 0 0.15rem rgba(34, 197, 94, 0.15) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2322c55e'%3E%3Cpath d='M16.704 5.29a1 1 0 010 1.415l-7.2 7.2a1 1 0 01-1.415 0l-3.2-3.2a1 1 0 011.415-1.415l2.493 2.493 6.493-6.493a1 1 0 011.414 0z'/%3E%3C/svg%3E") !important;
}

/* INVALID */
input.form-control.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 0.15rem rgba(239, 68, 68, 0.18) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ef4444'%3E%3Cpath d='M10 2.5l8.5 15h-17L10 2.5zm0 5.5a1 1 0 00-1 1v3a1 1 0 002 0V9a1 1 0 00-1-1zm0 7a1.25 1.25 0 100-2.5A1.25 1.25 0 0010 15z'/%3E%3C/svg%3E") !important;
}

input.form-control.is-valid,
input.form-control.is-invalid {
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 1rem 1rem !important;
}

/* focus */
input.form-control.is-valid:focus {
    box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.25) !important;
}

input.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.28) !important;
}

/**
* 헬퍼 클래스
*/

/* 긴 문자열 우측 자르기 */
body {
    flex-shrink: 0;
}
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 자르면 안되는 형제요소 */
.text-truncate-off {
    flex-shrink: 0;
}
