/* 로그인 페이지 스타일 */

/* 테스트용 삼각형 버튼 스타일 */
.top-left {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.test-clear-button {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.square-clear-btn {
    width: 3rem;
    height: 3rem;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    border-radius: 0.4rem;
}

.square-clear-btn:hover {
    background: rgba(255, 82, 82, 0.2);
    transform: scale(1.1);
}

/* 다크모드에서 투명 버튼 호버 효과 */
.dark .square-clear-btn:hover {
    background: rgba(255, 138, 128, 0.2);
}

/* CSS 변수 정의 - 채점표와 동일한 스케일 */
:root {
    font-size: 62.5%; /* 1rem = 10px 기준으로 설정 */

    /* 폰트 패밀리 변수 */
    --font-primary: 'SUIT Variable', sans-serif;
    --font-mono: 'D2Coding', 'D2 coding', monospace;
    
    /* BeerCSS 기본 변수 오버라이드 - 채점표와 동일 */
    --font-size: 1.6rem;           /* 기본 폰트 크기 (16px) */
    --line-height: 1.6;            /* 기본 줄 높이 */
    
    /* 간격 변수 - 채점표와 동일 */
    --space-xs: 0.4rem;     /* 4px */
    --space-sm: 0.8rem;     /* 8px */
    --space-md: 1.6rem;     /* 16px */
    --space-lg: 2.4rem;     /* 24px */
    --space-xl: 3.2rem;     /* 32px */
    --space-2xl: 4.8rem;    /* 48px */
    
    /* 글자 크기 변수 - 채점표와 동일 */
    --scale-xs: 1.2rem;     /* 12px */
    --scale-sm: 1.4rem;     /* 14px */
    --scale-md: 1.6rem;     /* 16px */
    --scale-lg: 1.8rem;     /* 18px */
    --scale-xl: 2.0rem;     /* 20px */
    --scale-2xl: 2.4rem;    /* 24px */
    --scale-3xl: 3.0rem;    /* 30px */
}

/* 기본 body 스타일 */
body {
    font-family: var(--font-primary);
    font-size: 1.6rem;      /* 16px (채점표와 동일) */
    line-height: 1.6;
}

/* 다크모드 토글 버튼 */
.dark-mode-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.dark-mode-toggle .circle {
    width: 3.5rem !important;
    height: 3.5rem !important;
    font-size: 3.5rem !important;
}

button.circle i {
    font-size: 2.4rem !important;
    color: var(--on-surface-variant);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    line-height: 1 !important;
}

/* 메인 컨테이너 */
.login-container {
    height: 100%;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

/* 로그인 섹션 */
.login-section {
    width: 100%;
    max-width: 100%;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 제목 섹션 */
.title-section {
    margin-bottom: 2rem;
}

.main-title {
    margin: 0 0 var(--space-xs) 0;
    color: var(--on-surface-variant);
    font-size: var(--scale-3xl);
}

.sub-title {
    margin: 0;
    color: var(--on-surface);
    font-weight: 600;
    font-size: var(--scale-lg); /* 18px (채점표와 동일) */
}

/* 설명 텍스트 */
.description-text {
    margin-bottom: var(--space-lg);
    color: var(--on-surface-variant);
    line-height: 1.4;
    font-size: var(--scale-lg); /* 18px (채점표와 동일) */
}

/* 로그인 폼 */
.login-form {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 입력 필드 */
.input-field {
    margin-bottom: var(--space-md); /* 16px (위아래 여백 증가) */
    font-size: var(--scale-md); /* 16px (채점표와 동일) */
}

.input-field:last-of-type {
    margin-bottom: 0.75rem;
}

.input-field input {
    height: 4.2rem;
    font-size: var(--scale-md); /* 16px (채점표와 동일) */
    padding: var(--space-md) var(--space-md) !important; /* 위아래 16px, 좌우 16px 여백 강제 적용 */
}

/* Input 필드 label 스타일 */
.input-field label {
    font-size: 1.6rem !important; /* 16px (채점표와 동일) */
    font-weight: 500 !important;
    color:#948f99 !important;
    /* margin-bottom: var(--space-xs) !important; */
    /* display: block !important; */
    transition: font-size 0.3s ease; /* 폰트 크기 변경 애니메이션 */
    line-height: 5rem !important;
    padding-left: 0.8rem !important; /* 포커싱되지 않았을 때 왼쪽 여백 추가 */
    gap: 0.8rem !important; /* label 내부 요소 간격 */
}

/* Input 포커싱 시 label 폰트 크기 변경 */
.input-field input:focus + label,
.input-field input:focus ~ label {
    font-size: 1.2rem !important; /* 12px (포커싱 시 축소) */
    color: #948f94 !important;
    line-height: 1.2rem !important;
}

/* Input에 값이 있을 때 label active 상태 강제 적용 */
.input-field input:not(:placeholder-shown) + label,
.input-field input:not(:placeholder-shown) ~ label {
    font-size: 1.2rem !important; /* 12px (값이 있을 때 축소) */
    color: #948f94 !important;
    line-height: 1.2rem !important;
}

/* Select 필드 스타일 - input과 시각적 일관성 유지 */
.input-field select {
    height: 4.2rem;
    font-size: var(--scale-md);
    padding: 0 !important;
    padding-left: 1.7rem !important;
    background: transparent !important;
    color: var(--on-surface);
    /* border: 1px solid var(--outline); */
    border-radius: 0.4rem;
    cursor: pointer;
}

/* 심사과정 셀렉트는 한 줄 유지 + 넘침 말줄임 처리 */
#course {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.input-field select:focus {
    border-color: var(--primary);
    outline: none;
}

.input-field select:disabled {
    background-color: var(--surface-variant);
    color: var(--on-surface-variant);
    cursor: not-allowed;
}

/* Select 필드 label 스타일 */
.input-field select + label,
.input-field select ~ label {
    font-size: 1.6rem !important;
    font-weight: 500 !important;
    color: #948f99 !important;
    transition: font-size 0.3s ease;
    line-height: 5rem !important;
}

/* Select 포커싱 시 label 폰트 크기 변경 */
.input-field select:focus + label,
.input-field select:focus ~ label {
    font-size: 1.2rem !important;
    color: #948f94 !important;
    line-height: 1.2rem !important;
}

/* Select에 값이 있을 때 label active 상태 */
.input-field select:not([value=""]) + label,
.input-field select:not([value=""]) ~ label {
    font-size: 1.2rem !important;
    color: #948f94 !important;
    line-height: 1.2rem !important;
}

/* 조별 응시자 수 선택 필드 특별 스타일 */
#groupSize {
    background-color: var(--surface);
    color: var(--on-surface);
}

#groupSize:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.2);
}

#groupSize:disabled {
    background-color: var(--surface-variant);
    color: var(--on-surface-variant);
    cursor: not-allowed;
    opacity: 0.6;
}

.input-field label::after {
    content: '';
    display: inline-block;
    margin-left: 0.4em;
    vertical-align: middle;

    /* 필요에 따라 아래 속성 추가 */
    /* width: 0.6em; */
    /* height: 0.6em; */
    /* background: #ff4757; */
    /* border-radius: 50%; */
}
/* 버튼 컨테이너 */
.button-container {
    text-align: center;
    margin-top: 2.3rem;
}

/* 로그인 버튼 */
.login-button {
    height: 3.75rem;
    font-size: var(--scale-lg); /* 18px (채점표와 동일) */
    font-weight: 600;
    width: 10rem;
}

.login-button .material-symbols-outlined {
    margin-right: 0.5rem;
}

/* 메시지 토스트 */
.message-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background-color: var(--primary);
    color: var(--on-primary);
    padding: 1.2rem 2rem;
    border-radius: 0.8rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
    z-index: 1000;
    font-size: var(--scale-md);
    max-width: calc(100% - 4rem); /* 좌우 패딩 고려 */
    width: 100%; /* 가로 최대 너비로 설정 */
    box-sizing: border-box; /* 패딩이 너비에 포함되도록 */
    text-align: center;
}

.message-toast.error {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0.5rem 2rem rgba(255, 71, 87, 0.3);
}

.message-toast.success {
    background: linear-gradient(135deg, #2ed573, #1e90ff);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0.5rem 2rem rgba(46, 213, 115, 0.3);
}

/* 특별한 에러 타입별 스타일 */
.message-toast.error.duplicate-exam-number {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    box-shadow: 0 0.5rem 2rem rgba(255, 107, 107, 0.4);
}

.message-toast.error.connection-error {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    box-shadow: 0 0.5rem 2rem rgba(255, 167, 38, 0.4);
}

.message-toast.error.access-denied {
    background: linear-gradient(135deg, #ef5350, #e53935);
    box-shadow: 0 0.5rem 2rem rgba(239, 83, 80, 0.4);
}

.message-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 반응형 디자인 */
@media (max-width: 600px) {
    .login-container {
        padding: 1rem;
    }
    
    .main-title {
        font-size: var(--scale-3xl); /* 16px (채점표와 동일) */
    }
    
    .sub-title {
        font-size: var(--scale-2xl); /* 14px (채점표와 동일) */
    }
    
    .description-text {
        font-size: var(--scale-md); /* 12px (채점표와 동일) */
    }
    
    .login-form {
        max-width: 100%;
    }
}
