/* ===== InCommon Co-Branded Login Page Styles ===== */

:root {
    --bg-color: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --card-bg: #f7f8fa;
    --btn-primary-bg: #282B34;
    --btn-primary-text: #fff;
    --text-primary: #000;
    --border-color: #e2e5e9;
    --input-border: #d0d5dd;
    --input-focus: #E87722;
    --incommon-orange: #E87722;
    --form-card-bg: #fff;
    --form-card-shadow: 0 8px 40px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
}
html.dark-theme {
    --bg-color: #0c0c0e;
    --text-color: #e4e4e7;
    --text-muted: #9ca3af;
    --card-bg: #161820;
    --btn-primary-bg: #E87722;
    --btn-primary-text: #fff;
    --text-primary: #fff;
    --border-color: #2a2d38;
    --input-border: #3d3f4a;
    --input-focus: #E87722;
    --form-card-bg: #1a1c26;
    --form-card-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

/* ===== Layout ===== */
.login-wrapper { display: flex; min-height: 100vh; }

/* ===== Left Panel ===== */
.brand-panel {
    width: 480px; min-width: 480px;
    background: #14151c;
    display: flex; flex-direction: column;
    position: relative; overflow: hidden;
}
.brand-panel-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 10% 90%, rgba(232,119,34,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 90% 10%, rgba(232,119,34,0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 60% at 50% 50%, rgba(40,43,52,0.9) 0%, transparent 70%);
}
.brand-panel-grid {
    position: absolute; inset: 0; opacity: 0.03;
    background-image:
        linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
    background-size: 48px 48px;
}
.brand-panel-orb { position: absolute; border-radius: 50%; filter: blur(60px); }
.brand-panel-orb.orb-1 { width: 300px; height: 300px; top: -80px; right: -60px; background: rgba(232,119,34,0.1); }
.brand-panel-orb.orb-2 { width: 220px; height: 220px; bottom: -40px; left: -40px; background: rgba(232,119,34,0.07); }
.brand-panel-orb.orb-3 { width: 160px; height: 160px; top: 50%; left: 60%; transform: translate(-50%, -50%); background: rgba(255,255,255,0.02); }

.brand-panel-content {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; justify-content: center;
    flex: 1; padding: 48px 44px;
}

/* Co-brand logos */
.brand-logos { display: flex; align-items: center; gap: 0; margin-bottom: 40px; }
.brand-logos .bl-card {
    background: #fff; border-radius: 12px; padding: 14px 22px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12); min-height: 64px;
}
.brand-logos .bl-card img { height: 36px; display: block; }
.brand-logos .bl-divider { width: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-logos .bl-divider::before { content: ''; width: 1px; height: 40px; background: rgba(255,255,255,0.12); }

/* Heading & description */
.brand-heading { margin-bottom: 0; }
.brand-heading h1 { color: #fff; font-size: 30px; font-weight: 700; line-height: 1.25; margin: 0 0 16px; }
.brand-heading p { color: rgba(255,255,255,0.55); font-size: 15px; line-height: 1.65; margin: 0; }

/* Bottom bar */
.brand-panel-footer { position: relative; z-index: 1; padding: 20px 40px; border-top: 1px solid rgba(255,255,255,0.06); }
.brand-panel-footer p { color: rgba(255,255,255,0.25); font-size: 11px; line-height: 1.5; }

/* ===== Right Panel ===== */
.login-panel {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 24px; background: var(--card-bg); position: relative;
    overflow-y: auto; min-height: 0;
}
.login-panel::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--incommon-orange), #f4a261, var(--incommon-orange));
    display: none;
}
.login-panel-inner { width: 100%; max-width: 600px; }

/* Form card */
.form-card {
    background: var(--form-card-bg); border-radius: 16px; padding: 36px 32px;
    box-shadow: var(--form-card-shadow); border: 1px solid var(--border-color);
}

/* Mobile brand */
.mobile-brand { display: none; margin-bottom: 24px; }
.mobile-brand-inner {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    background: var(--form-card-bg); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 14px 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.mobile-brand-inner .m-sep { color: var(--border-color); font-size: 18px; font-weight: 300; }

/* Heading */
.login-heading { margin-bottom: 24px; }
.login-heading h1 { font-size: 24px; font-weight: 700; color: var(--text-color); margin: 0 0 4px; }
.login-heading p { font-size: 14px; color: var(--text-muted); margin: 0; }

/* ===== Tabs ===== */
.login-tabs {
    display: flex; background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 4px; margin-bottom: 24px;
}
html.dark-theme .login-tabs { background: #12131a; }
.login-tabs .tab-btn {
    flex: 1; text-align: center; padding: 10px 8px; border-radius: 7px;
    border: none; background: transparent; color: var(--text-muted);
    font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s ease;
}
.login-tabs .tab-btn:hover { color: var(--text-color); }
.login-tabs .tab-btn.active {
    background: var(--form-card-bg); color: var(--text-color);
    font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
html.dark-theme .login-tabs .tab-btn.active { background: #282b34; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* Tab content */
.tab-content-panel { display: none; }
.tab-content-panel.active { display: block; }

/* ===== Form Fields ===== */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-color); margin-bottom: 6px; }
.form-field .input-wrap { position: relative; }
.form-field input {
    width: 100%; height: 46px; padding: 0 42px 0 42px;
    border: 1.5px solid var(--input-border); border-radius: 10px;
    font-size: 14px; color: var(--text-color); background: var(--bg-color);
    transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
html.dark-theme .form-field input { background: #0c0c0e; }
.form-field input:focus { border-color: var(--input-focus); box-shadow: 0 0 0 3px rgba(232,119,34,0.12); }
.form-field input::placeholder { color: var(--text-muted); font-size: 14px; }
.form-field .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #bbb; font-size: 15px; pointer-events: none; }
html.dark-theme .form-field .input-icon { color: #666; }
.form-field .eye-toggle {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    color: #bbb; cursor: pointer; font-size: 15px; padding: 4px; transition: color 0.15s;
}
.form-field .eye-toggle:hover { color: var(--text-color); }

/* ===== Buttons ===== */
.btn-login {
    width: 100%; height: 46px; border: none; border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login-primary {
    background: linear-gradient(135deg, #282B34 0%, #1e2028 100%);
    color: #fff; box-shadow: 0 2px 8px rgba(40,43,52,0.2);
}
.btn-login-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(40,43,52,0.35); }
html.dark-theme .btn-login-primary { background: linear-gradient(135deg, #E87722 0%, #d06a1e 100%); box-shadow: 0 2px 8px rgba(232,119,34,0.2); }
html.dark-theme .btn-login-primary:hover { box-shadow: 0 6px 20px rgba(232,119,34,0.35); }
.btn-login-outline { background: transparent; color: var(--text-color); border: 1.5px solid var(--border-color); }
.btn-login-outline:hover { border-color: var(--incommon-orange); background: rgba(232,119,34,0.04); }

.form-actions { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 20px; }
.forgot-link { font-size: 13px; color: var(--incommon-orange); text-decoration: none; font-weight: 500; }
.forgot-link:hover { text-decoration: underline; }

/* SSO tab */
.sso-panel-header { padding: 0 0 18px; }
.sso-panel-header p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* Theme toggle */
.theme-toggle-float {
    position: fixed; bottom: 24px; right: 24px; width: 40px; height: 40px;
    border-radius: 50%; border: 1px solid var(--border-color); background: var(--form-card-bg);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 100; transition: all 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.theme-toggle-float:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.theme-toggle-float i { color: var(--text-color); font-size: 16px; }

/* ===== Secondary Views ===== */
.secondary-view { display: none; }
.secondary-view .sec-card {
    background: var(--form-card-bg); border: 1px solid var(--border-color);
    border-radius: 16px; padding: 32px; box-shadow: var(--form-card-shadow);
}
.secondary-view .sec-card-header { text-align: center; margin-bottom: 24px; }
.secondary-view .sec-card-header img { height: 32px; margin-bottom: 12px; }
.secondary-view .sec-card-header .logo-dark { display: inline; }
.secondary-view .sec-card-header .logo-light { display: none; }
html.dark-theme .secondary-view .sec-card-header .logo-dark { display: none; }
html.dark-theme .secondary-view .sec-card-header .logo-light { display: inline; }
.secondary-view .sec-card-header h3 { font-size: 18px; font-weight: 600; color: var(--text-color); }
.secondary-view .table { color: var(--text-color); border-color: var(--border-color); }
.secondary-view .table thead th {
    background: var(--card-bg); color: var(--text-color);
    border-color: var(--border-color); font-size: 13px; font-weight: 600; padding: 10px 12px;
}
.secondary-view .table tbody td {
    background: var(--form-card-bg); color: var(--text-color);
    border-color: var(--border-color); padding: 10px 12px; font-size: 13px; vertical-align: middle;
}
.secondary-view .table-striped > tbody > tr:nth-of-type(odd) > td {
    background: var(--card-bg); color: var(--text-color);
}
.secondary-view .table-striped > tbody > tr:nth-of-type(even) > td {
    background: var(--form-card-bg); color: var(--text-color);
}
html.dark-theme .secondary-view .table thead th { background: #1e2028; border-color: #2d2f3a; }
html.dark-theme .secondary-view .table tbody td { background: #1a1c26; border-color: #2d2f3a; }
html.dark-theme .secondary-view .table-striped > tbody > tr:nth-of-type(odd) > td { background: #1e2028; }
html.dark-theme .secondary-view .table-striped > tbody > tr:nth-of-type(even) > td { background: #1a1c26; }
/* Override Bootstrap .btn-primary inside InCommon secondary views */
.secondary-view .btn-primary {
    background: linear-gradient(135deg, #282B34 0%, #1e2028 100%);
    border-color: #282B34;
    color: #fff;
    font-size: 12px;
    padding: 4px 12px;
}
.secondary-view .btn-primary:hover {
    background: #1e2028;
    border-color: #1e2028;
}
html.dark-theme .secondary-view .btn-primary {
    background: linear-gradient(135deg, #E87722 0%, #d06a1e 100%);
    border-color: #E87722;
}
html.dark-theme .secondary-view .btn-primary:hover {
    background: #d06a1e;
    border-color: #d06a1e;
}
.secondary-view .back-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--incommon-orange); text-decoration: none; font-weight: 500; margin-top: 20px;
}
.secondary-view .back-link:hover { text-decoration: underline; }
.totp-note {
    background: rgba(232,119,34,0.06); border-radius: 10px; padding: 14px 16px;
    font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5;
    border-left: 3px solid var(--incommon-orange);
}
html.dark-theme .totp-note { background: rgba(232,119,34,0.1); }
.table-scroll { overflow: visible; }

/* Secondary views need more width for table content */
.secondary-view { width: 100%; }
.secondary-view .sec-card { padding: 28px 24px; margin: 0 auto; }
.secondary-view .table-responsive { overflow: visible; }
.secondary-view .table { white-space: normal; table-layout: auto; width: 100%; }
.secondary-view .table td, .secondary-view .table th { word-break: break-word; }

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .brand-panel { display: none; }
    .mobile-brand { display: block; }
    .login-panel { padding: 32px 16px; }
    .login-panel::before { display: block; }
    .form-card { padding: 28px 24px; }
}
@media (max-width: 480px) {
    .form-card { padding: 24px 18px; border-radius: 12px; }
}
