:root {
    --hf-primary: #0056b3;
    --hf-primary-hover: #004494;
    --hf-bg: #f4f7f6;
    --hf-text: #333333;
    --hf-border: #cccccc;
    --hf-white: #ffffff;
    --hf-radius: 8px;
    --hf-alert-bg: #e2f0e5;
    --hf-alert-text: #2e6a3c; 
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--hf-bg);
    color: var(--hf-text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.hf-container {
    background-color: var(--hf-white);
    padding: 30px;
    border-radius: var(--hf-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 500px;
}

.hf-title {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 22px;
    color: var(--hf-primary);
    text-align: center;
}

.hf-form-group {
    margin-bottom: 20px;
}

.hf-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.hf-radio-group {
    display: flex;
    gap: 15px;
    background-color: var(--hf-bg);
    padding: 10px;
    border-radius: var(--hf-radius);
    border: 1px solid var(--hf-border);
}

.hf-radio-group label {
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hf-input, .hf-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius);
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
    color: var(--hf-text);
    background-color: var(--hf-white);
}

.hf-select {
    cursor: pointer;
}

.hf-input:focus, .hf-select:focus {
    outline: none;
    border-color: var(--hf-primary);
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.2);
}

.hf-row {
    display: flex;
    gap: 15px;
}

.hf-col {
    flex: 1;
}

.hf-hidden {
    display: none !important;
}

.hf-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--hf-primary);
    color: var(--hf-white);
    border: none;
    border-radius: var(--hf-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.hf-btn:hover {
    background-color: var(--hf-primary-hover);
}

.hf-btn:disabled {
    background-color: #999999;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Spinner & Process Overlay Styles */
.hf-process-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.hf-process-content {
    background-color: var(--hf-white);
    padding: 40px;
    border-radius: var(--hf-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 450px;
    max-width: 90vw;
    max-height: 90vh;
    box-sizing: border-box;
}

.hf-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid var(--hf-border);
    border-top: 4px solid var(--hf-primary);
    border-radius: 50%;
    animation: hf-spin 1s linear infinite;
    margin-bottom: 15px;
}

.hf-success-icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hf-progress-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--hf-primary);
    text-align: center;
}

@keyframes hf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cancel Button */
.hf-btn-cancel {
    margin-top: 25px;
    padding: 10px 20px;
    background-color: #e04646;
    color: var(--hf-white);
    border: none;
    border-radius: var(--hf-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.hf-btn-cancel:hover {
    background-color: #c03535;
}

/* Debug Styles */
.hf-debug-wrapper {
    width: 100%;
    margin-top: 20px;
}

.hf-debug-log {
    background-color: #1e1e1e;
    color: #00ff00;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    padding: 15px;
    border-radius: var(--hf-radius);
    max-height: 250px;
    overflow-y: auto;
    border: 2px solid #e04646;
    line-height: 1.4;
    text-align: left;
}

.hf-debug-log div {
    margin-bottom: 4px;
    word-wrap: break-word;
}

/* Login Box Styles */
.hf-login-box {
    background-color: var(--hf-white);
    padding: 40px 30px;
    border-radius: var(--hf-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-sizing: border-box;
}

.hf-login-box h2 {
    color: var(--hf-primary);
    margin-top: 0;
    margin-bottom: 25px;
}

/* Top Navigation Buttons */
.hf-logout-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #e04646;
    color: var(--hf-white);
    padding: 10px 16px;
    text-decoration: none;
    border-radius: var(--hf-radius);
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background-color 0.2s ease;
}

.hf-logout-btn:hover {
    background-color: #c03535;
}

.hf-pwd-btn {
    position: fixed;
    top: 20px;
    right: 130px;
    background-color: #4CAF50;
    color: var(--hf-white);
    padding: 10px 16px;
    text-decoration: none;
    border-radius: var(--hf-radius);
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background-color 0.2s ease;
}

.hf-pwd-btn:hover {
    background-color: #45a049;
}

.hf-help-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background-color: var(--hf-primary);
    color: var(--hf-white);
    padding: 10px 16px;
    text-decoration: none;
    border-radius: var(--hf-radius);
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background-color 0.2s ease;
}

.hf-help-btn:hover {
    background-color: var(--hf-primary-hover);
}

/* Modal Styles */
.hf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.hf-modal {
    background-color: var(--hf-white);
    width: 80vw;
    height: 80vh;
    border-radius: var(--hf-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hf-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.hf-modal-close:hover {
    color: var(--hf-primary);
}

.hf-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--hf-border);
    background-color: var(--hf-bg);
}

.hf-modal-header h2 {
    margin: 0;
    color: var(--hf-primary);
    font-size: 22px;
}

.hf-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
}

.hf-modal-body h3 {
    color: var(--hf-primary);
    margin-top: 25px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--hf-bg);
    padding-bottom: 5px;
}

.hf-modal-body h3:first-child {
    margin-top: 0;
}

.hf-modal-body code {
    background-color: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    color: #d63384;
}

.hf-modal-body ul {
    padding-left: 20px;
}

.hf-modal-body li {
    margin-bottom: 15px;
}

/* NEU: Live Password Validation Styles */
.hf-pwd-rules {
    list-style-type: none;
    padding: 0;
    margin: 10px 0 0 0;
    font-size: 13px;
}

.hf-pwd-rules li, .hf-pwd-match-rule {
    margin-bottom: 4px;
    color: #e04646; 
    display: flex;
    align-items: center;
}

.hf-pwd-match-rule {
    font-size: 13px;
    margin-top: 5px;
}

.hf-pwd-rules li::before, .hf-pwd-match-rule::before {
    content: '❌';
    margin-right: 8px;
    font-size: 10px;
}

.hf-pwd-rules li.valid, .hf-pwd-match-rule.valid {
    color: var(--hf-alert-text);
}

.hf-pwd-rules li.valid::before, .hf-pwd-match-rule.valid::before {
    content: '✅';
}