/* NHM skin overrides for Roundcube 1.6.x, built on top of elastic. */

:root {
  --nhm-accent: #1fb2de;
  --nhm-accent-strong: #00acff;
  --nhm-accent-soft: #ebf9ff;
  --nhm-link: #00acff;
  --nhm-link-hover: #008acc;
  --nhm-surface: #f4f4f4;
  --nhm-sidebar: #17253c;
  --nhm-text: #161b1d;
  --nhm-border: #dddddd;
}

body {
  color: var(--nhm-text);
}

#layout-content > .header,
#layout-list > .header,
#layout-sidebar > .header,
.listing thead td,
.listing thead th,
.formcontent .formbuttons,
.records-table thead th {
  background: var(--nhm-surface);
}

a,
.listing li a,
.listing tbody tr a,
.propform a {
  color: var(--nhm-link);
}

a:focus,
a:hover {
  color: var(--nhm-link-hover);
}

.btn-primary,
.button.mainaction,
input.button.mainaction,
button.mainaction,
.formbuttons input.button.mainaction {
  background: var(--nhm-accent);
  border-color: var(--nhm-accent);
  color: #fff;
}

.btn-primary:focus,
.btn-primary:hover,
.button.mainaction:focus,
.button.mainaction:hover,
input.button.mainaction:focus,
input.button.mainaction:hover,
button.mainaction:focus,
button.mainaction:hover {
  background: var(--nhm-accent-strong);
  border-color: var(--nhm-accent-strong);
}

input[type='text'],
input[type='password'],
input[type='email'],
input[type='number'],
select,
textarea {
  border-color: #ced4da;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--nhm-accent);
  box-shadow: 0 0 0 0.2rem rgba(31, 178, 222, 0.25);
}

.listing li.selected,
.listing tbody tr.selected td,
.listing tbody tr.selected th,
.listing.focus tbody tr.selected td,
.listing.focus tbody tr.selected th {
  background: var(--nhm-accent-soft);
}

/* Elastic compiles some accent colors directly into component CSS.
   Override the most visible badge/progress elements here. */
.folderlist li.mailbox .unreadcount,
.folderlist li.mailbox.recent > a > .unreadcount {
  background: var(--nhm-accent) !important;
  color: #fff !important;
}

.folderlist li.mailbox.recent > a {
  color: var(--nhm-accent-strong) !important;
}

.quota-widget .value {
  background-color: var(--nhm-accent) !important;
}

#layout-menu #logo,
#layout-content #logo,
#layout-sidebar #logo {
  max-height: 38px;
}

#layout-menu #logo {
  max-height: 55px;
  padding: 5px 0;
}

.task-login body,
body.task-login {
  background: linear-gradient(180deg, #f3f5f7 0%, #eef1f4 100%);
}

.task-login #logo {
  display: inline-block !important;
  position: inherit !important;
  top: auto !important;
  max-height: none !important;
}

.task-login #layout-content #logo {
  height: 75px;
}

.task-login #layout {
  min-height: 100vh;
}

.task-login #layout-content.nhm-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 32px 20px;
}

.task-login .nhm-login-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1fr);
  width: min(1080px, 100%);
  min-height: 680px;
  background: #ffffff;
  border: 1px solid rgba(22, 27, 29, 0.08);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(22, 27, 29, 0.12);
}

.task-login .nhm-login-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 48px;
  background:
    radial-gradient(circle at 18% 18%, rgba(31, 178, 222, 0.22), transparent 34%),
    linear-gradient(180deg, #f5f7f8 0%, #edf1f3 100%);
  border-right: 1px solid rgba(22, 27, 29, 0.06);
}

.task-login .nhm-login-brand-mark {
  order: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.task-login .nhm-login-brand-mark img {
  display: block;
  width: min(78%, 320px);
  max-width: 360px;
  max-height: 160px;
  opacity: 1;
}

.task-login .nhm-login-brand-copy {
  order: 1;
  flex: 0 0 auto;
  width: 100%;
  color: var(--nhm-text);
  text-align: center;
}

.task-login .nhm-login-eyebrow {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nhm-accent);
}

.task-login .nhm-login-brand-copy h2 {
  margin: 0 0 14px;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.task-login .nhm-login-brand-copy p:last-child {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: #4c5a62;
}

.task-login .nhm-login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 64px;
}

.task-login .nhm-login-form-panel #logo {
  display: block;
  width: auto;
  margin: 0 0 28px;
}

.task-login .nhm-login-intro {
  margin-bottom: 26px;
}

.task-login .nhm-login-intro h2 {
  margin: 0 0 10px;
  font-size: 40px;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--nhm-text);
}

.task-login .nhm-login-intro p {
  margin: 0;
  max-width: 420px;
  font-size: 15px;
  line-height: 1.6;
  color: #56656d;
}

.task-login #login-form {
  top: auto;
  width: 100%;
  max-width: none;
  margin: 0;
}

.task-login #login-form table,
.task-login #login-form tbody,
.task-login #login-form tr,
.task-login #login-form td {
  display: block;
  width: 100%;
}

.task-login #login-form tr + tr {
  margin-top: 18px;
}

.task-login #login-form td.title {
  margin-bottom: 8px;
  padding: 0;
}

.task-login #login-form td.title label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--nhm-text);
}

.task-login #login-form td.input {
  padding: 0;
}

.task-login #login-form .form-control {
  height: 56px;
  border-radius: 14px;
  border: 1px solid #ced4da;
  padding: 0 16px;
  font-size: 16px;
  box-shadow: none;
  background: #fff;
}

.task-login #login-form .form-control:focus {
  border-color: var(--nhm-accent);
  box-shadow: 0 0 0 4px rgba(31, 178, 222, 0.14);
}

.task-login #login-form .formbuttons {
  margin: 28px 0 0;
}

.task-login #rcmloginsubmit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
}

.task-login #login-footer {
  margin-top: 18px;
  padding: 0;
  background: transparent;
  color: #6f7d85;
  font-size: 13px;
}

.task-login #login-footer > div {
  margin: 0;
  padding: 0;
  background: transparent;
}

@media (max-width: 960px) {
  .task-login #layout-content.nhm-login-page {
    padding: 20px;
  }

  .task-login .nhm-login-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .task-login .nhm-login-brand-panel {
    min-height: 260px;
    padding: 32px 28px;
    border-right: 0;
    border-bottom: 1px solid rgba(22, 27, 29, 0.06);
  }

  .task-login .nhm-login-brand-mark img {
    width: min(62%, 240px);
  }

  .task-login .nhm-login-form-panel {
    padding: 32px 28px 36px;
  }

  .task-login .nhm-login-intro h2 {
    font-size: 34px;
  }
}

@media (max-width: 640px) {
  .task-login .nhm-login-card {
    border-radius: 22px;
  }

  .task-login .nhm-login-brand-panel {
    min-height: 210px;
    padding: 28px 22px;
  }

  .task-login .nhm-login-brand-copy h2 {
    font-size: 28px;
  }

  .task-login .nhm-login-form-panel {
    padding: 28px 22px 32px;
  }

  .task-login .nhm-login-intro h2 {
    font-size: 30px;
  }
}

#messagestack .error,
.error,
.confirmation,
.warning {
  border-radius: 6px;
}
