:root {
    --primary-color: #ff5100;
    --primary-hover: #e04800;
    --primary-active: #c23f00;
    --primary-light: #ffe0d1;
    --text-color: #202030;
    --background-color: #FFFFFF;
    --error-color: #dc3545;
    --success-color: #28a745;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --grey: #F6F6F6;
    --dark-blue: #202030;
}

/* Base styles */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--grey);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
.header {
    text-align: center;
    margin-bottom: 2rem;
    display: none;
}

.header.show {
    display: block;
}

.chat-header {
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-logo {
    max-width: 200px;
    height: auto;
}

.logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

/* Form styles */
.login-section {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 48px 32px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.logo-section {
    margin-bottom: 32px;
}

.logo-image {
    max-width: 200px;
    height: auto;
    margin: 0 auto 16px;
    display: block;
}

.app-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark-blue);
    margin: 0 0 8px 0;
}

.app-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

.login-content {
    margin-top: 24px;
}

.features {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.features-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 16px 0;
}

.feature-list {
    display: grid;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
    text-align: left;
}

.feature-icon {
    width: 16px;
    height: 16px;
    background: #ff5100;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.feature-icon::after {
    content: 'âœ“';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.login-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.powered-by {
    font-size: 12px;
    color: #9ca3af;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.copyright {
    font-size: 11px;
    color: #9ca3af;
    margin: 0;
}

.login-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-blue);
    margin: 0 0 8px 0;
}

.login-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    color: #1f2937;
    background: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #ff5100;
    box-shadow: 0 0 0 3px rgba(255, 81, 0, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

input[type="text"],
input[type="password"] {
    /* Styles moved to .form-input */
}

input[type="text"]:focus,
input[type="password"]:focus {
    /* Styles moved to .form-input:focus */
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Button styles */
.login-btn {
    width: 100%;
    background: #ff5100;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-icon {
    font-size: 18px;
    font-weight: bold;
}

.login-btn:hover {
    background: #e04800;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 81, 0, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-button,
.submit-button,
.logout-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.login-button:hover,
.submit-button:hover,
.logout-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.login-button:active,
.submit-button:active,
.logout-button:active {
    background-color: var(--primary-active);
}

.button-container {
    text-align: center;
    margin-top: 1rem;
}

/* Question form styles */
.question-form {
    max-width: 800px;
    margin: 0 auto;
}

.question-input {
    min-height: 100px;
    resize: vertical;
}

/* Answer container styles */
.answer-container {
    max-width: 800px;
    margin: 2rem auto;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: white;
}

.qa-pair {
    background-color: var(--grey);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.qa-pair h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 0.5rem;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* Error styles */
.error-message {
    color: var(--error-color);
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* User controls */
.user-display {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0 0 4px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .footer {
        display: none !important;
    }

    .login-section {
        padding: 10px;
        min-height: 100vh;
    }

    .login-card {
        padding: 32px 24px;
    }

    .logo-image {
        max-width: 150px;
    }

    .app-title {
        font-size: 20px;
    }

    .user-controls {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .qa-pair {
        padding: 1rem;
    }

    body.chat-page {
        padding: 0;
        height: 100vh;
        height: 100dvh;
    }

    .chat-container {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        max-width: none;
    }

    .chat-container .chat-header {
        padding: 12px 15px;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        justify-content: space-between;
        align-items: center;
    }

    .chat-container .chat-logo {
        position: static;
        max-width: 32px;
        margin: 0;
    }

    .chat-container .chat-logo-wrapper {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .chat-container .chat-header .logout-button {
        position: static;
        width: auto;
        margin-top: 0;
        padding: 10px 12px;
        font-size: 12px;
    }

    .chat-messages {
        padding: 15px;
    }

    .message-content {
        max-width: 85%;
        font-size: 14px;
    }

    .chat-input-container {
        padding: 15px;
    }

    .chat-input-wrapper {
        flex-direction: row;
    }

    #messageInput {
        font-size: 16px;
    }

    .chat-container button:not(#sendButton):not(.logout-button):not(.cancel-btn) {
        width: 100%;
        padding: 12px;
    }

    .new-session-btn {
        margin-top: 8px;
    }
    
    .copy-btn {
        display: none !important;
    }

    .session-item-actions {
        opacity: 1 !important;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px 16px;
    }

    .logo-image {
        max-width: 120px;
    }

    .app-title {
        font-size: 18px;
    }

    .form-input {
        font-size: 16px;
    }

    .chat-container .chat-logo {
        max-width: 100px;
    }

    .chat-container .chat-header h1 {
        font-size: 16px;
    }

    .message-content {
        max-width: 90%;
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* Typography */
h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Footer styles */
.footer {
    text-align: center;
    margin-top: 0;
    padding: 1rem;
    color: #6c757d;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    display: none;
}

#authenticatedContent ~ .footer {
    display: block;
}

.footer .powered-by {
    font-size: 12px;
    color: #9ca3af;
    margin: 0 0 8px 0;
    font-weight: 500;
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Focus styles for accessibility */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Typing effect styles */
#typing-text p {
    margin-bottom: 1rem;
}

/* Chat styles */
body.chat-page {
    background: var(--grey);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-container {
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-container .chat-header {
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    flex-shrink: 0;
}

.chat-container .chat-logo-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
}

.chat-container .chat-logo {
    max-width: 150px;
    height: auto;
}

.chat-container .chat-header h1 {
    font-size: 20px;
    margin-bottom: 0;
    color: white;
}

.chat-container .chat-header h1 .mobile-title {
    display: none;
}

.chat-container .chat-header p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--grey);
}

.message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease-in;
    position: relative;
}

.message .message-content {
    position: relative;
}

.copy-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: white !important;
    color: black !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: background 0.2s !important;
}

.copy-btn.visible {
    opacity: 1;
}

.copy-btn:hover {
    background: #f0f0f0 !important;
    color: black !important;
    transform: none !important;
    box-shadow: none !important;
}

.message.user .copy-btn {
    background: var(--primary-color) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
}

.message.user .copy-btn:hover {
    background: var(--primary-hover) !important;
    color: white !important;
}


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

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

.message.assistant .message-content {
    background: white;
    color: var(--text-color);
    box-shadow: 0 2px 5px var(--shadow-color);
}

.message.system .message-content {
    background: #fff3cd;
    color: #856404;
    max-width: 100%;
    text-align: center;
    font-size: 14px;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
}

.input-bubble {
    display: flex;
    align-items: center;
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    background: white;
    padding: 4px 4px 4px 16px;
    transition: border-color 0.3s;
}

.input-bubble:focus-within {
    border-color: var(--primary-color);
}

#messageInput {
    flex: 1;
    padding: 8px 0;
    border: none;
    font-size: 15px;
    outline: none;
    background: transparent;
}

#messageInput:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

.input-bubble #sendButton {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.input-bubble #sendButton:hover:not(:disabled) {
    background: var(--primary-hover);
}

.input-bubble #sendButton:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-container button:not(#sendButton):not(.logout-button):not(.cancel-btn) {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-container button:hover:not(:disabled):not(.copy-btn):not(#sendButton):not(.cancel-btn) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 81, 0, 0.4);
}

.chat-container button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.typing-indicator {
    display: none;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 2px 5px var(--shadow-color);
    max-width: 300px;
}

.typing-indicator.active {
    display: block;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span.typing-status {
    height: auto;
    width: auto;
    background: none;
    border-radius: 0;
    animation: none;
    margin-left: 8px;
    font-size: 0.85em;
    color: #666;
    vertical-align: middle;
    display: inline;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.new-session-btn {
    margin-top: 10px;
    width: 100%;
    background: #6c757d;
}

/* Session sidebar */
.session-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
}

.session-overlay.active {
    display: block;
}

.session-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.session-sidebar.active {
    left: 0;
}

.session-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.session-sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.session-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    line-height: 1;
}

.session-new-btn {
    margin: 12px 16px;
    padding: 10px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.session-new-btn:hover {
    background: var(--primary-hover);
}

.session-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.session-item {
    padding: 12px 20px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-item:hover {
    background: var(--grey);
}

.session-item.active {
    background: var(--primary-light);
    border-left-color: var(--primary-color);
}

.session-item-text {
    flex: 1;
    min-width: 0;
}

.session-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-item-date {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.session-item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.session-item:hover .session-item-actions {
    opacity: 1;
}

.session-action-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s;
}

.session-action-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.session-delete-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}

.session-delete-btn:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.session-item.pinned {
    background: #fffbf7;
}

.pin-icon {
    font-size: 11px;
}

.session-rename-input {
    width: 100%;
    padding: 2px 6px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.session-sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-clear-btn {
    width: 100%;
    padding: 8px 16px;
    background: none;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.session-clear-btn:hover {
    background: rgba(220, 53, 69, 0.08);
}

.session-logout-btn {
    width: 100%;
    padding: 8px 16px;
    background: none;
    color: #6c757d;
    border: 1px solid #6c757d;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.session-logout-btn:hover {
    background: rgba(108, 117, 125, 0.08);
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    color: white;
}

.hamburger-btn:hover {
    opacity: 0.8;
}

.cancel-btn {
    margin-top: 8px;
    width: 100%;
    background: white;
    color: #ff5100;
    border: 2px solid #ff5100;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.cancel-btn:hover {
    background: #fff0e8;
}

.session-info {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    text-align: center;
}

.chat-footer {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.chat-container .chat-header .logout-button {
    padding: 8px 16px;
    font-size: 14px;
}

/* =============================================
   MFA Styles — TOTP code entry & enrollment
   ============================================= */

/* MFA section container — matches .login-content layout */
.mfa-section {
    width: 100%;
}

/* QR code container — centered with padding */
.qr-code-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0;
    margin: 8px 0 16px;
}

.qr-code-container canvas,
.qr-code-container img {
    border-radius: 8px;
}

/* Secret key display — monospace, copyable text */
.secret-key-display {
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace;
    font-size: 14px;
    letter-spacing: 1px;
    background: var(--grey);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0 20px;
    word-break: break-all;
    text-align: center;
    color: var(--text-color);
    user-select: all;
    -webkit-user-select: all;
    cursor: text;
}

/* MFA step instructions */
.mfa-instructions {
    font-size: 14px;
    color: #6b7280;
    margin: 12px 0 4px;
    text-align: left;
    line-height: 1.5;
}

/* Back to Sign In link */
.back-link-container {
    text-align: center;
    margin-top: 16px;
}

.back-link {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.back-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading spinner state for verify buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading .btn-icon,
.btn-loading span:not(.btn-spinner) {
    visibility: hidden;
}

.btn-loading .btn-spinner {
    visibility: visible;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* =============================================
   Password Management Styles
   ============================================= */

/* Password criteria checklist container */
.password-criteria {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0 16px;
    padding: 0;
    text-align: left;
}

/* Individual criterion row */
.password-criteria-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

/* Met criterion — green checkmark */
.password-criteria-item.met {
    color: var(--success-color);
}

/* Unmet criterion — red X */
.password-criteria-item.unmet {
    color: var(--error-color);
}

/* "Forgot Password?" link container */
.forgot-password-container {
    text-align: center;
    margin-top: 8px;
}

/* "Forgot Password?" link — matches .back-link appearance */
.forgot-password-link {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.forgot-password-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Change Password button in session sidebar footer */
.session-change-pwd-btn {
    width: 100%;
    padding: 8px 16px;
    background: none;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.session-change-pwd-btn:hover {
    background: rgba(255, 81, 0, 0.08);
}

/* Success message (green text for password changed/reset feedback) */
.success-message {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Modal button row (Change Password + Cancel) */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.modal-actions .login-btn {
    flex: 1;
}

/* Secondary cancel button for modals */
.modal-cancel-btn {
    flex: 1;
    padding: 12px 24px;
    background: white;
    color: #6c757d;
    border: 1px solid #6c757d;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-cancel-btn:hover {
    background: rgba(108, 117, 125, 0.08);
}

.modal-cancel-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
