/* CTH Custom Auth CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
    --binance-gold: #0052FF; /* Coinbase Blue */
    --binance-dark-bg: #0B1426; /* Navy Background */
    --binance-card-bg: #131B2F; /* Navy Card */
    --binance-text-light: #EAECEF;
    --binance-text-muted: #848E9C;
    --binance-border: rgba(255, 255, 255, 0.1);
}

/* Full Page Container */
.cth-auth-container {
    min-height: 100vh;
    width: 100vw !important;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    max-width: 100vw !important;
    z-index: 9999;
    background-image: linear-gradient(rgba(24, 26, 32, 0.85), rgba(24, 26, 32, 0.95)), url('https://images.pexels.com/photos/6801648/pexels-photo-6801648.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: flex-start; /* Ensure top isn't cut off if card is tall */
    justify-content: center;
    font-family: 'Inter', sans-serif;
    color: var(--binance-text-light);
    padding: 60px 20px !important; /* Generous padding for scrolling */
    box-sizing: border-box;
    overflow-x: hidden;
}

.auth-card {
    background-color: var(--binance-card-bg);
    width: 100%;
    max-width: 550px !important; /* Increased for desktop */
    padding: 40px !important;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    border: 1px solid var(--binance-border);
    animation: fadeIn 0.5s ease-out;
    align-self: flex-start;
    margin: auto 0; /* Centers vertically if there's space, but respects flex-start */
}

.auth-card.wide {
    max-width: 900px !important; /* Increased for wider registration table look */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.company-name {
    color: var(--binance-gold);
    text-align: center;
    font-size: 28px; /* Reduced slightly */
    font-weight: 800;
    margin-bottom: 8px;
}

.auth-prompt {
    text-align: center;
    color: var(--binance-text-muted);
    margin-bottom: 25px;
    font-size: 14px;
}

/* Form Styling - WHITE INPUTS, BLACK TEXT */
.cth-form .form-group {
    margin-bottom: 20px;
}

.cth-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--binance-text-light);
}

.cth-form input[type="text"],
.cth-form input[type="password"],
.cth-form input[type="email"],
.cth-form input[type="number"],
.cth-form select {
    width: 100%;
    height: 48px;
    background-color: #FFFFFF !important; /* CRITICAL REQUEST */
    color: #000000 !important; /* CRITICAL REQUEST */
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0 15px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s;
}

.cth-form input:focus {
    border-color: var(--binance-gold);
    outline: none;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 45px !important;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #181A20; /* Balanced with white input bg */
    z-index: 10;
    font-size: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .cth-auth-container { padding: 30px 15px !important; }
    .auth-card { padding: 30px 20px !important; width: 100%; max-width: 100% !important; margin: 0 auto; box-sizing: border-box; }
    .form-grid { grid-template-columns: 1fr; gap: 12px; }
    .company-name { font-size: 24px; }
    .auth-prompt { margin-bottom: 20px; font-size: 14px; }
    .cth-form .form-group { margin-bottom: 12px; }
    .cth-form label { font-size: 13px; margin-bottom: 5px; }
    .cth-form input[type="text"],
    .cth-form input[type="password"],
    .cth-form input[type="email"],
    .cth-form select { 
        height: 44px; 
        font-size: 15px; 
    }
    .auth-btn { height: 46px; font-size: 15px; }
}

/* Select2 Theme Customization */
.select2-container--default .select2-selection--single {
    background-color: #FFFFFF !important;
    border: 1px solid #ced4da !important;
    border-radius: 6px !important;
    height: 48px !important;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #000000 !important;
    padding-left: 15px !important;
    font-size: 16px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
}
.select2-dropdown {
    background-color: #131B2F !important;
    color: #EAECEF !important;
    border: 1px solid var(--binance-border) !important;
    z-index: 99999 !important;
}
/* Base option text color */
.select2-container--default .select2-results > .select2-results__options {
    color: #EAECEF !important; 
}
.select2-container--default .select2-results__option,
li.select2-results__option {
    color: #EAECEF !important;
    padding: 8px 15px !important;
}

/* Hovered / Highlighted option */
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[aria-selected]:hover {
    background-color: var(--binance-gold) !important;
    color: #FFFFFF !important;
}

.select2-search--dropdown {
    background-color: #131B2F !important;
}
.select2-search--dropdown .select2-search__field {
    background-color: #0B1426 !important;
    color: #FFFFFF !important;
    border: 1px solid var(--binance-border) !important;
}

.auth-btn {
    width: 100%;
    height: 48px;
    background-color: var(--binance-gold);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s;
    margin-top: 10px;
}

.auth-btn:hover {
    filter: brightness(1.1);
}

.auth-link {
    display: block;
    text-align: center;
    color: var(--binance-gold);
    margin-top: 15px;
    text-decoration: none;
    font-size: 14px;
}

.switch-auth {
    text-align: center;
    margin-top: 25px;
    color: var(--binance-text-muted);
    font-size: 14px;
}

.switch-auth a {
    color: var(--binance-gold);
    text-decoration: none;
    font-weight: 600;
}

/* Account Page Layout */
.cth-account-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.account-header h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--binance-text-light);
    margin-bottom: 30px;
}

.account-layout {
    display: flex;
    gap: 30px;
}

.account-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--binance-card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--binance-border);
    height: fit-content;
}

.user-info {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--binance-border);
}

.user-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--binance-gold);
    margin-bottom: 10px;
}

.account-tabs {
    list-style: none;
    padding: 0;
    margin: 0;
}

.account-tabs li {
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--binance-text-muted);
    transition: all 0.2s;
    margin-bottom: 5px;
}

.account-tabs li i {
    margin-right: 10px;
    width: 20px;
}

.account-tabs li:hover, .account-tabs li.active {
    background: rgba(0, 82, 255, 0.1);
    color: var(--binance-gold);
}

.account-content {
    flex: 1;
    background: var(--binance-card-bg);
    border-radius: 12px;
    padding: 40px;
    border: 1px solid var(--binance-border);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.status-box {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 25px;
}

.status-rejected { background: rgba(246, 70, 93, 0.1); border: 1px solid #f6465d; }

.soft-2fa-group { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 15px; margin-top: 15px; }
.auth-hint { font-size: 11px; color: var(--binance-text-muted); margin-top: 5px; font-style: italic; }

.security-upgrade-prompt {
    background: rgba(4, 190, 110, 0.05);
    border: 1px solid rgba(4, 190, 110, 0.15);
    padding: 20px;
    border-radius: 12px;
    margin: 25px 0;
    text-align: center;
}
.security-upgrade-prompt i { font-size: 28px; color: #04be6e; margin-bottom: 15px; display: block; }
.security-upgrade-prompt p { font-size: 13px; color: var(--binance-text-light); margin-bottom: 15px; font-weight: 500; }
.security-upgrade-prompt .auth-btn.small { width: auto; padding: 0 25px; height: 36px; background: #04be6e; border: none; }
.security-upgrade-prompt .auth-btn.small:hover { background: #03a660; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(4, 190, 110, 0.3); }

.status-pending { background: rgba(240, 185, 11, 0.1); border: 1px solid #0052FF; color: #0052FF; }
.status-verified { background: rgba(4, 190, 110, 0.1); border: 1px solid #04be6e; color: #04be6e; }
.status-success { color: #04be6e; font-weight: 600; font-size: 13px; }

/* Verification 2.0 */
.verification-progress-container { margin-bottom: 30px; }
.progress-labels { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; color: var(--binance-text-muted); }
.progress-bar-bg { background: rgba(255,255,255,0.05); height: 8px; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--binance-gold); transition: width 0.5s ease; box-shadow: 0 0 10px var(--binance-gold); }

.verification-status-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.v-card { background: rgba(255,255,255,0.02); border: 1px solid var(--binance-border); padding: 25px 20px; border-radius: 12px; text-align: center; transition: all 0.3s; }
.v-card i { font-size: 32px; color: var(--binance-text-muted); margin-bottom: 15px; }
.v-card h4 { font-size: 16px; margin-bottom: 10px; color: var(--binance-text-light); }
.v-card.active { border-color: var(--binance-gold); background: rgba(0, 82, 255, 0.05); }
.v-card.active i { color: var(--binance-gold); }

.v-badge { font-size: 11px; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; background: rgba(255,255,255,0.1); color: var(--binance-text-muted); font-weight: 700; }
.v-badge.publish { background: #04be6e; color: white; }
.v-badge.pending { background: #0052FF; color: #181A20; }
.v-badge.trash, .v-badge.rejected { background: #f6465d; color: white; }

.upload-zone { background: rgba(0,0,0,0.15); border: 2px dashed var(--binance-border); padding: 25px; border-radius: 12px; text-align: center; transition: all 0.2s; cursor: pointer; }
.upload-zone:hover { border-color: var(--binance-gold); background: rgba(0, 82, 255, 0.02); }
.upload-zone i { font-size: 24px; color: var(--binance-gold); margin-bottom: 10px; }
.upload-zone h5 { margin: 0 0 5px; font-size: 14px; }
.upload-zone p { margin: 0; font-size: 12px; color: var(--binance-text-muted); }
.upload-zone input[type="file"] { margin-top: 15px; font-size: 12px; width: 100%; }

/* History Table */
.history-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.history-table th { text-align: left; padding: 12px; font-size: 13px; color: var(--binance-text-muted); border-bottom: 1px solid var(--binance-border); }
.history-table td { padding: 12px; font-size: 14px; border-bottom: 1px solid var(--binance-border); }

@media (max-width: 850px) {
    .verification-status-cards { grid-template-columns: 1fr; gap: 10px; }
    .upload-zone { padding: 15px; }
    .history-table th, .history-table td { font-size: 12px; padding: 8px; }
}

@media (max-width: 850px) {
    .cth-account-container { margin: 10px auto; padding: 0 10px; max-width: 100%; box-sizing: border-box; }
    .account-header h1 { font-size: 24px; margin-bottom: 20px; }
    .account-layout { flex-direction: column; gap: 15px; width: 100%; }
    .account-sidebar { width: 100% !important; padding: 15px; flex-shrink: 1; box-sizing: border-box; }
    .user-info { margin-bottom: 15px; padding-bottom: 10px; display: flex; flex-direction: column; align-items: center; }
    .user-avatar img { width: 60px; height: 60px; }
    .user-info h3 { font-size: 16px; }
    .account-tabs li { padding: 10px; font-size: 14px; }
    .account-content { padding: 20px 15px; }
    .account-content h3 { font-size: 18px; margin-bottom: 15px; }
    .cth-form label { font-size: 12px; }
    .cth-form input, .cth-form select { height: 40px; font-size: 14px; }
    .auth-btn.small { height: 40px; font-size: 14px; }
    .status-box { padding: 10px; font-size: 13px; }
}

/* 2FA Styling */
.auth-divider { border: none; border-top: 1px solid var(--binance-border); margin: 30px 0; }
.auth-info-text { color: var(--binance-text-muted); font-size: 14px; margin-bottom: 20px; }
.secret-text { background: rgba(0,0,0,0.2); padding: 10px; border-radius: 4px; display: inline-block; margin-top: 15px; font-size: 13px; }
#2fa-qr-code { padding: 15px; background: white; border-radius: 8px; display: inline-block; margin: 15px 0; }
.danger { background: #f6465d !important; color: white !important; }

/* 2FA Guide */
.cth-2fa-guide h4 { color: var(--binance-gold); margin: 20px 0 10px; font-size: 16px; }
.cth-2fa-guide p { color: var(--binance-text-light); font-size: 14px; }

/* Custom Checkbox */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 30px;
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 14px;
    color: var(--binance-text-muted);
    user-select: none;
}
.checkbox-container input { visibility: hidden; position: absolute; }
.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: var(--binance-card-bg);
    border: 1px solid var(--binance-border);
    border-radius: 4px;
}
.checkbox-container:hover input ~ .checkmark { background-color: rgba(0, 82, 255, 0.1); }
.checkbox-container input:checked ~ .checkmark { background-color: var(--binance-gold); }
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #181A20;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-container input:checked ~ .checkmark:after { display: block; }

/* Radio Button Styling */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}
.radio-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 14px;
    color: var(--binance-text-light);
    user-select: none;
}
.radio-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.radio-mark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--binance-card-bg);
    border: 1px solid var(--binance-border);
    border-radius: 50%;
}
.radio-container:hover input ~ .radio-mark {
    background-color: rgba(0, 82, 255, 0.1);
}
.radio-container input:checked ~ .radio-mark {
    background-color: var(--binance-gold);
    border-color: var(--binance-gold);
}
.radio-mark:after {
    content: "";
    position: absolute;
    display: none;
    top: 5px;
    left: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FFFFFF;
}
.radio-container input:checked ~ .radio-mark:after {
    display: block;
}

.auth-error {
    background: rgba(246, 70, 93, 0.1);
    color: #f6465d;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid #f6465d;
    text-align: center;
}
