/* caftory extends Elastic: keep Roundcube's layout, interactions and accessibility. */
:root {
  --cf-ink: #15243b;
  --cf-muted: #66768b;
  --cf-blue: #0876e5;
  --cf-border: #e3e9f1;
  --cf-surface: #f4f7fb;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Leelawadee UI", Tahoma, sans-serif; color: var(--cf-ink); }
a { color: var(--cf-blue); }
button, input, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #53aaff !important; outline-offset: 3px; }
.btn-primary { background: var(--cf-blue); border-color: var(--cf-blue); border-radius: 9px; }
.btn-primary:hover, .btn-primary:focus { background: #0664c2; border-color: #0664c2; }
.form-control { border-color: #d5deea; border-radius: 8px; }
.form-control:focus { border-color: #1685f8; box-shadow: 0 0 0 3px #1685f81a; }

/* Full-height sign-in, with the real Roundcube form and CSRF handling. */
body.task-login { background: #fff; }
.task-login #layout { display: block; width: 100%; height: 100%; }
.task-login #layout-content.caftory-login { display: grid; grid-template-columns: minmax(400px, 46%) 1fr; width: 100%; height: 100%; min-height: 700px; margin: 0; padding: 0; overflow: auto; background: #fff; text-align: left; }
.mail-story { position: relative; display: flex; flex-direction: column; padding: 38px 48px 28px; background: #102238; color: #fff; overflow: hidden; }
.mail-story::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .2; background-image: radial-gradient(#8ab8ec 0.7px, transparent 0.7px); background-size: 28px 28px; mask-image: linear-gradient(transparent, #000); }
.story-brand { display: flex; align-items: center; gap: 12px; position: relative; font-size: 28px; font-weight: 650; letter-spacing: -1px; }
.story-brand img { width: 36px; height: 36px; }
.brand-label { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: 2px; color: #adbed2; margin-left: 15px; padding-left: 15px; border-left: 1px solid #536073; vertical-align: middle; }
.story-main { position: relative; margin: auto 0; padding-top: 42px; }
.eyebrow { display: block; font-size: 10px; font-weight: 700; letter-spacing: 2.1px; }
.mail-story .eyebrow { color: #b8c8dc; margin-bottom: 24px; }
.mail-story h1 { font-size: clamp(42px, 4.5vw, 68px); font-weight: 500; line-height: 1.1; letter-spacing: -2.6px; margin: 0 0 24px; }
.mail-story h1 em { font-family: Georgia, serif; font-weight: 400; color: #a9d1ff; }
.mail-story p { color: #c3cfde; font-size: 14px; line-height: 1.9; margin: 0; }
.story-footer { position: relative; display: flex; justify-content: space-between; gap: 12px; color: #b2c2d5; font-size: 8px; letter-spacing: 1.35px; margin-top: 18px; }
.mail-art { position: relative; height: 230px; max-width: 330px; margin: 10px auto 0; }
.orbit { position: absolute; border: 1px solid #456386; border-radius: 50%; width: 300px; height: 180px; left: 8px; top: 26px; transform: rotate(-28deg); }
.orbit-two { transform: rotate(28deg); width: 270px; height: 175px; left: 26px; top: 25px; border-color: #304b6b; }
.letter { position: absolute; width: 145px; height: 156px; border-radius: 9px; left: 86px; top: 15px; }
.letter-back { background: #5688c4; transform: rotate(-17deg); }
.letter-front { background: #e9f3ff; transform: rotate(9deg); padding: 15px; box-shadow: 0 6px 25px #0002; }
.letter-icon { color: #187ee0; font-size: 28px; line-height: 1; margin-bottom: 15px; }
.letter-line { display: block; width: 91px; height: 5px; background: #a6c3e6; margin: 9px 0; border-radius: 4px; }
.letter-line.short { width: 63px; }
.letter-sign { font: italic 11px Georgia, serif; color: #356393; }
.envelope { position: absolute; left: 60px; top: 95px; width: 205px; height: 119px; border-radius: 7px 7px 13px 13px; background: #459aff; transform: rotate(-7deg); box-shadow: 0 16px 26px #0002; overflow: hidden; }
.envelope::before, .envelope::after { content: ""; position: absolute; inset: 0; background: #7ab7ff; clip-path: polygon(0 0, 60% 70%, 0 100%); }
.envelope::after { background: #93c5ff; clip-path: polygon(100% 0, 40% 70%, 100% 100%); }
.envelope span { position: absolute; z-index: 1; inset: 0; background: #acd3ff; clip-path: polygon(0 100%, 50% 37%, 100% 100%); }
.art-dot { position: absolute; background: #98c8ff; width: 6px; height: 6px; border-radius: 50%; }
.dot-one { left: 8px; top: 115px; }.dot-two { right: 10px; top: 161px; width: 4px; height: 4px; }
.art-star { position: absolute; right: 19px; top: 15px; font-size: 38px; color: #b7d8ff; }
.mail-access { display: flex; flex-direction: column; padding: 38px 48px 28px; min-width: 0; }
.access-top, .access-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; color: var(--cf-muted); }
.access-brand { font-size: 14px; font-weight: 600; color: var(--cf-ink); }
.access-label { font-size: 8px; letter-spacing: 1.5px; }
.access-form { width: 100%; max-width: 370px; margin: auto; padding: 60px 0; }
.welcome-icon { width: 50px; height: 50px; margin-bottom: 27px; }
.welcome-icon img { width: 100%; height: 100%; }
.access-form > .eyebrow { color: var(--cf-blue); margin-bottom: 13px; }
.access-form h2 { font-size: 30px; line-height: 1.5; font-weight: 650; letter-spacing: -.7px; margin: 0 0 10px; }
.access-description { color: var(--cf-muted); font-size: 14px; line-height: 1.9; margin: 0 0 30px; }
.task-login #login-form { position: static; top: auto; width: 100%; max-width: none; margin: 0; text-align: left; }
.task-login #login-form .form-group { margin-bottom: 16px; }
.task-login #login-form input.form-control { height: 49px; font-size: 14px; background-color: #fbfcfe; }
.task-login #login-form .input-group-text { border-color: #d5deea; background: #f3f6fa; color: #6e7d90; }
.task-login #login-form button { height: 49px; font-size: 14px; font-weight: 600; margin-top: 8px; border-radius: 9px; box-shadow: 0 4px 10px #0876e520; }
.task-login #login-footer { text-align: left; margin: 0; }
.task-login #login-footer:empty { display: none; }
.account-hint { color: var(--cf-muted); font-size: 11px; line-height: 1.8; margin: 16px 0 25px; text-align: center; }
.account-hint strong { font-weight: 500; color: #384f6e; }
.access-help { border-top: 1px solid var(--cf-border); padding-top: 22px; font-size: 12px; }
.access-help > span { font-weight: 600; }
.access-help p { margin: 7px 0 0; color: var(--cf-muted); font-size: 11px; line-height: 1.8; }
.access-footer { font-size: 10px; line-height: 1.5; }
.access-footer span:last-child { font-size: 8px; letter-spacing: 1.2px; }

/* Mail, contacts and settings retain the parent skin's functional layout. */
body:not(.task-login) #layout { background: var(--cf-surface); }
body:not(.task-login) #layout-menu { background: #102238; border-right: 0; }
#taskmenu a { color: #c5d3e5; border-radius: 10px; margin: 5px 7px; }
#taskmenu a:hover { background: #243a56; color: #fff; }
#taskmenu a.selected { color: #fff; background: #0876e5; }
#taskmenu a.logout { color: #c5d3e5; }
#layout-sidebar { background: #f4f7fb; border-color: var(--cf-border); }
#layout-sidebar .header, #layout-list .header, #layout-content > .header { background: #fff; border-color: var(--cf-border); color: var(--cf-ink); }
#layout-sidebar .header { background: #f4f7fb; }
.listing li { border-color: var(--cf-border); }
.listing li.selected, .listing li.selected > a { background-color: #e4f0ff; color: #0665c3; }
#mailboxlist li > a { border-radius: 8px; margin: 3px 9px; padding-top: 10px; padding-bottom: 10px; }
#mailboxlist li.selected > a { font-weight: 600; }
#mailboxlist .unreadcount { background: #d7eaff; color: #0659ad; border-radius: 6px; }
#messagelist { color: var(--cf-ink); }
#messagelist td { border-color: #edf1f6; }
#messagelist tr.selected td { background: #eaf3ff; color: #133b6b; }
#messagelist tr:hover:not(.selected) td { background: #f7faff; }
#messagelist tr.unread td.subject { font-weight: 650; }
#messagelist td.subject { padding-top: 15px; padding-bottom: 15px; }
#messagelist td.subject .date, #messagelist td.subject .size { color: #67778d; }
.searchbar { background: #f8fafd; border-color: var(--cf-border); }
.searchbar input { color: var(--cf-ink); }
.toolbar a.button { color: #435671; border-radius: 7px; }
.toolbar a.button:hover { background: #eef5ff; color: #0665c3; }
.header, .footer { border-color: var(--cf-border); }
#message-header { padding: 20px; }
#message-header .subject { font-size: 23px; letter-spacing: -.5px; line-height: 1.4; }
/* Do not recolor the content of received HTML emails or their print view. */
@media (min-width: 1200px) {
  body:not(.task-login) #layout-sidebar { min-width: 220px; }
}
@media (max-width: 1000px) {
  .task-login #layout-content.caftory-login { grid-template-columns: 42% 1fr; }
  .mail-story, .mail-access { padding: 30px 28px 24px; }
  .mail-story h1 { font-size: 46px; }
  .mail-art { transform: scale(.85); transform-origin: center; margin-left: -15px; margin-right: -15px; }
  .story-footer span:last-child { display: none; }
}
@media (max-width: 700px) {
  .task-login #layout-content.caftory-login { display: block; min-height: 100%; height: auto; }
  .mail-story { display: none; }
  .mail-access { min-height: 100dvh; padding: 25px 24px 22px; }
  .access-form { padding: 45px 0; max-width: 400px; }
  .access-form h2 { font-size: 28px; }
  .access-label { font-size: 7px; letter-spacing: 1px; }
  .access-footer { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@media print { body, body:not(.task-login) #layout { background: #fff; } }
