/* --brand-primary/--brand-secondary default to the platform's fixed purple gradient --
   applyTenantBranding() in auth.js overrides these on :root when a tenant has a real ThemeEngine theme. */
:root {
    --brand-primary: #667eea;
    --brand-secondary: #764ba2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.login-box, .dashboard {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
}

/* Reuses app-shell.css's `.app-sidebar-brand-mark` (gradient square) outside its usual dark
   sidebar, so its own white text color needs restating here. */
.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.login-brand .app-sidebar-brand-mark {
    color: #fff;
}

.login-brand .app-wordmark-text {
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.field-hint {
    font-weight: 400;
    color: #888;
    font-size: 13px;
}

.tenant-resolved-banner {
    background: #eef1ff;
    color: #333;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #ccd3f7;
    text-align: center;
}

button {
    width: 100%;
    padding: 12px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #5568d3;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.error {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid #fcc;
}

.dashboard {
    text-align: center;
}

#userInfo {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 5px;
    margin: 30px 0;
    text-align: left;
}

#userInfo p {
    margin-bottom: 10px;
    color: #555;
}

#userInfo strong {
    color: #333;
}

.logout-btn {
    background: #dc3545;
    margin-top: 20px;
}

.logout-btn:hover {
    background: #c82333;
}

.admin-link {
    display: inline-block;
    padding: 12px 24px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.3s;
}

.admin-link:hover {
    background: #218838;
}

/* 2FA login-blocked panels (enrollment / backup codes / verification), namespaced under
   .twofa- so this never leaks into any other page's styling. */
.twofa-panel {
    margin-top: 10px;
}

.twofa-instructions {
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
}

.twofa-backup-warning {
    color: #333;
}

.twofa-qr-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.twofa-qr {
    width: 220px;
    height: 220px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    background: white;
}

.twofa-link-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--brand-primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
}

.twofa-link-btn:hover {
    color: #5568d3;
    background: none;
}

.sso-providers-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.sso-providers-divider {
    text-align: center;
    color: #888;
    font-size: 13px;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sso-providers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sso-provider-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: white;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.sso-provider-btn:hover {
    background: #f5f5f5;
}

.twofa-secret-reveal {
    background: #f5f5f5;
    padding: 14px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.twofa-secret-reveal label {
    margin-bottom: 6px;
}

.twofa-secret-text {
    display: block;
    font-size: 16px;
    letter-spacing: 1px;
    word-break: break-all;
    color: #333;
}

.twofa-error {
    margin-top: -6px;
}

.twofa-backup-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background: #f5f5f5;
    padding: 16px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.twofa-backup-list li {
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
    color: #333;
    text-align: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px 4px;
}

.twofa-back-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: var(--brand-primary);
    text-decoration: none;
    font-size: 14px;
}

.twofa-back-link:hover {
    text-decoration: underline;
}

/* Partners page -- namespaced under .partners-page so it never affects the narrow
   login/dashboard card layout above. */
.partners-page {
    max-width: 900px;
    width: 100%;
}

.partners-page .dashboard {
    text-align: left;
}

.partners-page h1 {
    text-align: left;
}

.partners-intro {
    color: #555;
    margin-bottom: 30px;
    line-height: 1.5;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

/* Same look as branding-console.css's .bc-locked-note -- kept here for plain pages like partners.html. */
.bc-locked-note {
    font-size: 13px;
    color: #a15c00;
    background: #fdf1de;
    border-radius: 6px;
    padding: 10px 14px;
}

.partner-card {
    background: #f9f9fc;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.partner-name {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.partner-tagline {
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.partner-visit-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--brand-primary);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
    transition: background 0.3s;
}

.partner-visit-btn:hover {
    background: #5568d3;
}
