* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.bt-page {
	min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px;
	background: #f8fafc; color: #333; font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}
.bt-card { width: 100%; max-width: 440px; background: #fff; border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.08); overflow: hidden; }

.bt-head { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 20px 24px; color: #fff; background: linear-gradient(135deg, #00a2e8, #0085c7); }
.bt-head::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.06); }
.bt-logo { position: relative; z-index: 2; width: 96px; flex: none; filter: brightness(0) invert(1); }
.bt-head-text { position: relative; z-index: 2; min-width: 0; padding-left: 16px; border-left: 1px solid rgba(255,255,255,.35); }
.bt-head h1 { margin: 0 0 2px; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.bt-head p { margin: 0; font-size: 13px; line-height: 1.35; color: #e6f5fc; }

.bt-body { padding: 26px 28px 18px; }
.bt-title { margin: 0 0 16px; font-size: 19px; font-weight: 600; color: #333; }

#login-form table, #login-form tbody, #login-form tr, #login-form td { display: block; width: 100%; border: 0; padding: 0; }
#login-form tr { position: relative; margin-bottom: 16px; }
#login-form td.title { margin-bottom: 6px; }
#login-form td.title label { font-weight: 600; color: #444; font-size: 14px; }
#login-form .form-control {
	width: 100%; height: 46px; padding: 0 14px; border: 2px solid #e1e8f0; border-radius: 10px; font: inherit; font-size: 15px;
	color: #333; background: #f8fafc; transition: border-color .2s, box-shadow .2s, background-color .2s;
}
#login-form .form-control:focus { outline: none; border-color: #00aaeb; background: #fff; box-shadow: 0 0 0 3px rgba(0,170,235,.15); }
#login-form .form-control::placeholder { color: #8a8f96; }
#login-form #rcmloginpwd { padding-right: 48px; }
.bt-eye { position: absolute; right: 2px; bottom: 1px; width: 44px; height: 44px; border: 0; background: none; color: #6b6b6b; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.bt-eye:hover { color: #0077b6; }
.bt-eye svg, .bt-submit svg, .bt-contacts svg, .bt-links svg, .bt-toast-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.bt-eye svg { width: 20px; height: 20px; }

#login-form p.formbuttons { margin: 4px 0 0; }
.bt-submit {
	width: 100%; min-height: 48px; padding: 12px; border: 0; border-radius: 10px; cursor: pointer;
	background: #0077b6; color: #fff; font: inherit; font-size: 16px; font-weight: 600;
	display: flex; align-items: center; justify-content: center; gap: 10px; transition: background-color .2s;
}
.bt-submit:hover { background: #005f92; }
.bt-submit:disabled { opacity: .85; cursor: default; }
.bt-submit.bt-error { background: #c81e1e !important; animation: bt-shake .35s; }
@keyframes bt-shake { 25% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-3px); } }

.bt-links { display: flex; justify-content: center; margin-top: 10px; }
.bt-links button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 10px; border: 0; background: none; color: #0077b6; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; border-radius: 8px; }
.bt-links button:hover { text-decoration: underline; }
.bt-links svg { width: 16px; height: 16px; }

.bt-contacts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 14px 20px; border-top: 1px solid #eee; background: #fafbfc; font-size: 13px; }
.bt-contacts a { display: inline-flex; align-items: center; gap: 6px; color: #333; text-decoration: none; }
.bt-contacts a:hover { color: #0077b6; text-decoration: underline; }
.bt-contacts svg { width: 14px; height: 14px; color: #0077b6; }

.bt-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15,23,42,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity .22s ease; }
.bt-modal[hidden] { display: none; }
.bt-modal.is-open { opacity: 1; }
.bt-modal-box { width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 20px; box-shadow: 0 24px 64px rgba(15,23,42,.35); opacity: 0; transform: translateY(18px) scale(.97); transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .22s ease; }
.bt-modal.is-open .bt-modal-box { opacity: 1; transform: none; }
.bt-modal-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 20px 20px 28px; color: #fff; background: linear-gradient(135deg, #00a2e8, #0085c7); }
.bt-modal-head h2 { margin: 0; font-size: 21px; line-height: 1.3; }
.bt-modal-close { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid rgba(255,255,255,.35); border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; transition: background-color .15s, transform .15s; }
.bt-modal-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.bt-modal-close:hover { background: rgba(255,255,255,.26); }
.bt-modal-close:active { transform: scale(.94); }
.bt-modal-close:focus-visible, .bt-seg button:focus-visible, .bt-links button:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
.bt-modal-body { padding: 26px 28px 28px; display: flex; flex-direction: column; gap: 20px; }
.bt-choose { display: flex; flex-direction: column; gap: 10px; }
.bt-choose-label { font-size: 15px; font-weight: 600; color: #374151; }
.bt-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 6px; background: #eef3f7; border-radius: 12px; }
.bt-seg button { min-height: 50px; padding: 6px 10px; border: 0; border-radius: 9px; background: transparent; color: #4b5563; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.bt-seg button small { font-size: 13px; font-weight: 400; }
.bt-seg button[aria-pressed="true"] { background: #fff; color: #0077b6; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.bt-hint { margin: 0; font-size: 14px; line-height: 1.5; color: #4b5563; }
.bt-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bt-box { border: 2px solid #e1e8f0; border-radius: 14px; overflow: hidden; }
.bt-box-head { padding: 12px 16px; background: #f1f6fa; font-weight: 600; color: #374151; }
.bt-box dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; margin: 0; padding: 16px; font-size: 15px; }
.bt-box dt { color: #595959; }
.bt-box dd { margin: 0; color: #333; word-break: break-all; }
.bt-box dd.hl { color: #0077b6; font-weight: 600; }
.bt-login-info { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; background: #f8fafc; border-radius: 12px; font-size: 15px; line-height: 1.45; color: #374151; }
.bt-login-info b { font-weight: 600; }

#messagestack { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bt-toasts { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; max-width: 380px; }
.bt-toast { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.15); animation: bt-in .4s ease-out; }
.bt-toast.bt-out { animation: bt-out .3s ease-in forwards; }
@keyframes bt-in { from { transform: translateX(120%); opacity: 0; } }
@keyframes bt-out { to { transform: translateX(120%); opacity: 0; } }
.bt-toast-ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.bt-toast-ic svg { width: 22px; height: 22px; }
.bt-toast.error .bt-toast-ic { background: #d63031; }
.bt-toast.warning .bt-toast-ic { background: #c27c0e; }
.bt-toast.success .bt-toast-ic { background: #1e8a4c; }
.bt-toast.info .bt-toast-ic { background: #0077b6; }
.bt-toast-text { flex: 1; min-width: 0; }
.bt-toast-title { font-size: 16px; font-weight: 600; color: #2d3436; margin-bottom: 4px; }
.bt-toast-msg { font-size: 14px; color: #555; line-height: 1.5; }
.bt-toast-close { width: 32px; height: 32px; border: 0; background: none; color: #777; font-size: 20px; cursor: pointer; border-radius: 8px; }
.bt-toast-close:hover { background: #f5f6fa; }

@media (prefers-reduced-motion: reduce) { .bt-modal, .bt-modal-box, .bt-toast { transition: none !important; animation: none !important; } }

.noscriptwarning { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; padding: 12px; text-align: center; background: #c81e1e; color: #fff; }

@media (max-width: 640px) {
	.bt-head { padding: 18px 18px; gap: 12px; }
	.bt-logo { width: 80px; }
	.bt-head-text { padding-left: 12px; }
	.bt-head h1 { font-size: 18px; }
	.bt-body { padding: 22px 20px 14px; }
	.bt-cols { grid-template-columns: 1fr; }
	.bt-modal { padding: 10px; }
	.bt-modal-head { padding: 16px 14px 16px 18px; }
	.bt-modal-head h2 { font-size: 18px; }
	.bt-modal-body { padding: 18px; }
	.bt-toasts { left: 12px; right: 12px; top: 12px; max-width: none; }
}
body.bt-page { display: block; min-height: 0; padding: 0; }
.bt-wrap { min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px; box-sizing: border-box; }
