/**
 * 로그인 페이지 스타일
 * DR-CPA
 */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #F5F5F5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 로그인 컨테이너 */
.login-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.login-box {
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

/* 로그인 헤더 */
.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    font-size: 32px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
}

.login-header .subtitle {
    font-size: 14px;
    color: #666666;
}

/* 에러 메시지 */
.error-message {
    background: #FFEBEE;
    border: 1px solid #FFCDD2;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 20px;
    color: #C62828;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message i {
    font-size: 18px;
}

/* 폼 그룹 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    margin-bottom: 8px;
}

/* Input wrapper */
.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #BDBDBD;
    font-size: 16px;
}

.input-wrapper .form-control {
    padding-left: 45px;
}

/* Form control */
.form-control {
    width: 100%;
    height: 48px;
    padding: 0 15px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-size: 15px;
    color: #333333;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-control::placeholder {
    color: #BDBDBD;
}

.form-control.no-icon {
    padding-left: 15px;
}

/* 로그인 버튼 */
.btn-login {
    width: 100%;
    height: 50px;
    background: #000000;
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #333333;
}

/* 로그인 푸터 */
.login-footer {
    margin-top: 25px;
    text-align: center;
}

.login-footer-links {
    font-size: 13px;
}

.login-footer-links a {
    color: #666666;
    text-decoration: none;
}

.login-footer-links a:hover {
    color: #000000;
    text-decoration: underline;
}

.login-footer-links .divider {
    color: #E0E0E0;
    margin: 0 10px;
}

/* ========================================
   로그인 탭 스타일
   ======================================== */

.login-tabs {
    display: flex;
    border-bottom: 2px solid #E0E0E0;
    margin-bottom: 25px;
}

.login-tab {
    flex: 1;
    padding: 14px 10px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: #999999;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    position: relative;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.login-tab:hover {
    color: #666666;
}

.login-tab.active {
    color: #000000;
    border-bottom-color: #000000;
}

.login-tab i {
    margin-right: 6px;
}

/* 탭 패널 */
.login-tab-panel {
    display: none;
}

.login-tab-panel.active {
    display: block;
}

/* 도메인 선택 래퍼 */
.domain-select-wrapper {
    position: relative;
}

.domain-select-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #BDBDBD;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.domain-select-wrapper select {
    width: 100%;
    height: 48px;
    padding: 0 15px 0 45px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-size: 15px;
    color: #333333;
    background: #FFFFFF;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.domain-select-wrapper select:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.domain-select-wrapper::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #BDBDBD;
    font-size: 12px;
    pointer-events: none;
}

/* 도메인관리자 안내 */
.domain-admin-info {
    background: #F5F5F5;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666666;
    line-height: 1.5;
}

.domain-admin-info i {
    color: #2196F3;
    margin-right: 6px;
}

/* 슈퍼관리자 뱃지 */
.login-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.login-type-badge.super {
    background: #FFF3E0;
    color: #E65100;
}

.login-type-badge.domain {
    background: #E3F2FD;
    color: #1565C0;
}

/* ========================================
   모달 스타일
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #FFFFFF;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #E0E0E0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333333;
}

.modal-body {
    padding: 25px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

/* 모달 안내 메시지 */
.modal-info {
    background: #F5F5F5;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666666;
    line-height: 1.6;
}

.modal-info i {
    color: #2196F3;
    margin-right: 8px;
}

/* 모달 버튼 */
.btn-modal {
    width: 100%;
    height: 46px;
    background: #000000;
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.btn-modal:hover {
    background: #333333;
}

.btn-modal.btn-secondary {
    background: #E0E0E0;
    color: #333333;
}

.btn-modal.btn-secondary:hover {
    background: #BDBDBD;
}

/* 인증 타이머 */
.verify-timer {
    margin-top: 10px;
    font-weight: 600;
    color: #F44336;
}

.verify-code-input {
    letter-spacing: 8px;
    font-size: 20px;
    text-align: center;
    font-weight: 600;
}

/* 모달 결과 */
.modal-result {
    text-align: center;
    padding: 20px 0;
}

.modal-result i {
    font-size: 48px;
    margin-bottom: 15px;
}

.modal-result.success i {
    color: #4CAF50;
}

.modal-result.error i {
    color: #F44336;
}

.modal-result h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 10px;
}

.modal-result p {
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
}

.modal-result p small {
    color: #999999;
}

.result-box {
    background: #F5F5F5;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
}

.result-box .label {
    font-size: 12px;
    color: #999999;
    margin-bottom: 5px;
}

.result-box .value {
    font-size: 20px;
    font-weight: 600;
    color: #000000;
    letter-spacing: 1px;
}

/* 필수 항목 표시 */
.required-mark {
    color: #F44336;
}

/* 숨김 클래스 */
.hidden {
    display: none !important;
}

/* ========================================
   Select2 도메인 선택 커스텀 스타일
   ======================================== */

/* Select2 컨테이너 기본 스타일 */
.domain-select2 + .select2-container {
    width: 100% !important;
}

.domain-select2 + .select2-container .select2-selection--single {
    min-height: 48px;
    height: auto;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    background: #FFFFFF;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.domain-select2 + .select2-container .select2-selection--single:focus,
.domain-select2 + .select2-container.select2-container--focus .select2-selection--single,
.domain-select2 + .select2-container.select2-container--open .select2-selection--single {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.domain-select2 + .select2-container .select2-selection__rendered {
    line-height: 1.4;
    padding: 10px 35px 10px 15px;
    color: #333333;
    font-size: 15px;
}

.domain-select2 + .select2-container .select2-selection__placeholder {
    color: #BDBDBD;
}

.domain-select2 + .select2-container .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: 10px;
}

.domain-select2 + .select2-container .select2-selection__arrow b {
    border-color: #BDBDBD transparent transparent transparent;
}

.domain-select2 + .select2-container .select2-selection__clear {
    margin-right: 25px;
    font-size: 18px;
    color: #999999;
}

.domain-select2 + .select2-container .select2-selection__clear:hover {
    color: #F44336;
}

/* Select2 드롭다운 스타일 */
.select2-dropdown {
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
}

.select2-search--dropdown {
    padding: 10px;
}

.select2-search--dropdown .select2-search__field {
    padding: 10px 15px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-size: 14px;
}

.select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: #000000;
}

.select2-results__options {
    max-height: 300px;
    overflow-y: auto;
}

.select2-results__option {
    padding: 0;
}

.select2-results__option--highlighted[aria-selected] {
    background: #F5F5F5;
    color: #333333;
}

.select2-results__option--selected {
    background: #E0E0E0;
}

.select2-results__message {
    padding: 15px;
    text-align: center;
    color: #999999;
    font-size: 14px;
}

/* 도메인 옵션 스타일 (드롭다운 항목) */
.domain-option {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFFFFF;
    border-bottom: 1px solid #F0F0F0;
}

.domain-option:last-child {
    border-bottom: none;
}

.select2-results__option--highlighted .domain-option {
    background: #FFF8E1;
}

.domain-option-loading {
    padding: 15px;
    text-align: center;
    color: #666666;
}

.domain-option-loading i {
    margin-right: 8px;
    color: #FF9800;
}

/* 도메인 라벨 (도메인명) - 주황색 뱃지 */
.domain-label {
    display: inline-block;
    background: #FF6D00;
    color: #FFFFFF;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 도메인 타이틀 (사이트명) - 진한 텍스트 */
.domain-title {
    font-size: 14px;
    color: #212121;
    font-weight: 500;
}

/* 선택된 값 스타일 */
.domain-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.domain-label-selected {
    display: inline-block;
    background: #FF6D00;
    color: #FFFFFF;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    white-space: nowrap;
}

.domain-title-selected {
    font-size: 13px;
    color: #212121;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   도메인 전용 로그인 모드
   ======================================== */

/* 도메인 직접 로그인 영역 */
.domain-direct-login {
    margin-top: 5px;
}

/* 도메인 정보 표시 */
.domain-direct-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F5F5F5;
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 24px;
}

.domain-direct-info > i {
    color: #FF6D00;
    font-size: 18px;
    flex-shrink: 0;
}

.domain-direct-name {
    font-size: 14px;
    font-weight: 600;
    color: #212121;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.domain-direct-badge {
    display: inline-block;
    background: #E3F2FD;
    color: #1565C0;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

/* ========================================
   미등록 도메인 안내
   ======================================== */

.unregistered-domain {
    text-align: center;
    padding: 30px 10px;
}

.unregistered-domain-icon {
    margin-bottom: 20px;
}

.unregistered-domain-icon i {
    font-size: 48px;
    color: #FF9800;
}

.unregistered-domain-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 12px;
}

.unregistered-domain-desc {
    font-size: 14px;
    color: #666666;
    line-height: 1.7;
    margin-bottom: 24px;
}

.unregistered-domain-desc strong {
    color: #333333;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.unregistered-domain-contact {
    background: #F5F5F5;
    border-radius: 4px;
    padding: 14px 16px;
    font-size: 13px;
    color: #666666;
}

.unregistered-domain-contact i {
    color: #2196F3;
    margin-right: 8px;
}

.unregistered-domain-contact strong {
    color: #333333;
}

/* ========================================
   반응형
   ======================================== */

@media (max-width: 480px) {
    .login-box {
        padding: 30px 25px;
    }

    .login-header .logo {
        font-size: 28px;
    }

    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }

    .modal-body {
        padding: 20px;
    }

    /* 도메인 전용 로그인 반응형 */
    .domain-direct-info {
        flex-wrap: wrap;
        gap: 8px;
    }

    .domain-direct-badge {
        margin-left: 0;
    }

    /* 미등록 도메인 반응형 */
    .unregistered-domain {
        padding: 20px 5px;
    }

    .unregistered-domain-icon i {
        font-size: 40px;
    }

    .unregistered-domain-title {
        font-size: 16px;
    }

    .unregistered-domain-desc {
        font-size: 13px;
    }
}
