/*
 * Dubai Harbour Marinas - admin authentication (sign-in and OTP verification).
 * Standalone stylesheet: neither view extends adminlte::master, so
 * nothing here has to fight AdminLTE.min.css / admin-theme.css. Keep it that way.
 * Design brief: Dubai_Harbour_Marinas_Login_Redesign.md (17 Sep 2026).
 */

:root {
    --dh-navy: #001E60;
    --dh-offwhite: #F8F4F0;
    --dh-white: #FFFFFF;
    --dh-turquoise: #009CBD;
    --dh-grey: #8D97AD;
    --dh-text-muted: #626B7B;
    --dh-border: #C8CDD5;
    --dh-error: #B42318;

    /* EB Garamond is self-hosted (public/fonts/eb-garamond). Georgia carries the
       serif direction until those files land, so the page never falls to Times. */
    --dh-font-serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
    --dh-font-sans: Corbel, 'Segoe UI', Arial, sans-serif;

    --dh-field-height: 56px;
    --dh-radius: 4px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.dh-login {
    margin: 0;
    min-height: 100svh;
    font-family: var(--dh-font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--dh-navy);
    background: var(--dh-offwhite);
}

.dh-login__grid {
    display: grid;
    grid-template-columns: 60fr 40fr;
    min-height: 100svh;
}

/* ---------------------------------------------------------------- *
 * Left: marina photography
 * ---------------------------------------------------------------- */

.dh-visual {
    position: relative;
    overflow: hidden;
    /* Shown when the approved photograph has not been dropped in yet, and as the
       backdrop while it decodes. */
    background: linear-gradient(170deg, #0B2C6B 0%, #003E7E 45%, #00648C 100%);
}

.dh-visual__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 60%;
}

/* Navy wash towards the bottom so the white headline stays readable over the
   brightest part of the photograph (the lit pontoons). */
.dh-visual__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(0, 30, 96, 0.35) 0%, rgba(0, 30, 96, 0) 30%),
        linear-gradient(to top, rgba(0, 30, 96, 0.78) 0%, rgba(0, 30, 96, 0.28) 34%, rgba(0, 30, 96, 0) 62%);
}

.dh-visual__content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px 56px;
}

.dh-visual__logo {
    width: 96px;
    height: auto;
}

.dh-visual__eyebrow {
    margin: 0 0 14px;
    font-size: 12px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
}

.dh-visual__headline {
    margin: 0;
    max-width: 12ch;
    font-family: var(--dh-font-serif);
    font-weight: 400;
    font-size: clamp(40px, 5.2vw, 76px);
    line-height: 1.04;
    color: var(--dh-white);
}

/* ---------------------------------------------------------------- *
 * Right: sign-in panel
 * ---------------------------------------------------------------- */

.dh-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 64px 56px 88px;
    background: var(--dh-offwhite);
}

.dh-panel__inner {
    width: 100%;
    max-width: 420px;
}

/* Compact navy logo above the form; only shown once the photo panel is hidden. */
.dh-panel__logo {
    display: none;
    width: 64px;
    height: auto;
    margin: 0 0 32px;
}

.dh-panel__eyebrow {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--dh-navy);
}

/* Semibold rather than the brief's regular weight, at the client's request. The
   600 cut of EB Garamond is fetched alongside the 400 so this is a real semibold,
   not a synthesised one. */
.dh-panel__title {
    margin: 0 0 10px;
    font-family: var(--dh-font-serif);
    font-weight: 600;
    font-size: clamp(36px, 3.6vw, 56px);
    line-height: 1.08;
    color: var(--dh-navy);
}

.dh-panel__subtitle {
    margin: 0 0 36px;
    font-size: 16px;
    color: var(--dh-text-muted);
}

/* ---------------------------------------------------------------- *
 * Form
 * ---------------------------------------------------------------- */

.dh-field {
    margin-bottom: 22px;
}

.dh-field__label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--dh-navy);
}

.dh-field__control {
    position: relative;
    display: block;
}

.dh-input {
    display: block;
    width: 100%;
    height: var(--dh-field-height);
    padding: 0 52px 0 16px;
    font-family: inherit;
    font-size: 16px;
    color: var(--dh-navy);
    background: var(--dh-white);
    border: 1px solid var(--dh-border);
    border-radius: var(--dh-radius);
    appearance: none;
}

.dh-input::placeholder {
    color: var(--dh-text-muted);
    opacity: 1;
}

.dh-input:focus {
    outline: 2px solid var(--dh-navy);
    outline-offset: 1px;
    border-color: var(--dh-navy);
}

.dh-input[aria-invalid="true"] {
    border-color: var(--dh-error);
}

/* Decorative envelope glyph; the password toggle below is a real button. */
.dh-field__icon {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    display: flex;
    color: var(--dh-grey);
    pointer-events: none;
}

.dh-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--dh-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--dh-radius);
    cursor: pointer;
}

.dh-toggle:hover {
    color: var(--dh-navy);
}

.dh-toggle:focus-visible {
    outline: 2px solid var(--dh-navy);
    outline-offset: 1px;
}

.dh-toggle__eye-off {
    display: none;
}

.dh-toggle[aria-pressed="true"] .dh-toggle__eye-off {
    display: block;
}

.dh-toggle[aria-pressed="true"] .dh-toggle__eye-on {
    display: none;
}

.dh-error {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    color: var(--dh-error);
}

.dh-error:empty {
    display: none;
}

/* Banner for authentication / throttle failures, above the submit button. */
.dh-alert {
    margin-bottom: 20px;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--dh-error);
    background: rgba(180, 35, 24, 0.07);
    border: 1px solid rgba(180, 35, 24, 0.35);
    border-radius: var(--dh-radius);
}

/* reCAPTCHA renders a fixed 304x78 iframe. Let it keep its own dimensions and
   only scale the whole widget down when the panel is genuinely narrower. */
.dh-captcha {
    margin-bottom: 22px;
}

.dh-captcha__widget {
    transform-origin: 0 0;
}

.dh-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    width: 100%;
    height: var(--dh-field-height);
    padding: 0 20px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    color: var(--dh-white);
    background: var(--dh-navy);
    border: 1px solid var(--dh-navy);
    border-radius: var(--dh-radius);
    cursor: pointer;
}

.dh-submit__arrow {
    position: absolute;
    right: 20px;
    display: flex;
}

.dh-submit:hover {
    background: #001749;
}

.dh-submit:focus-visible {
    outline: 2px solid var(--dh-navy);
    outline-offset: 2px;
}

.dh-submit[disabled] {
    opacity: 0.72;
    cursor: default;
}

/* "or" rule between the password form and the Office 365 route. */
.dh-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dh-text-muted);
}

.dh-divider::before,
.dh-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--dh-border);
}

/* Secondary action: same geometry as the primary button, outlined rather than
   filled, so the password form stays the obvious default. */
.dh-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: var(--dh-field-height);
    padding: 0 20px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--dh-navy);
    text-decoration: none;
    background: var(--dh-white);
    border: 1px solid var(--dh-border);
    border-radius: var(--dh-radius);
}

.dh-sso:hover {
    border-color: var(--dh-navy);
}

.dh-sso:focus-visible {
    outline: 2px solid var(--dh-navy);
    outline-offset: 2px;
}

.dh-sso__mark {
    flex: none;
}

.dh-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    font-size: 16px;
    color: var(--dh-navy);
    text-decoration: none;
}

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

.dh-back:focus-visible {
    outline: 2px solid var(--dh-navy);
    outline-offset: 3px;
}

/* Same affordance as .dh-back, but the OTP screen has to POST to log out
   rather than follow a link. */
.dh-back--button {
    padding: 0;
    font-family: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

/* ---------------------------------------------------------------- *
 * Panel footer
 * ---------------------------------------------------------------- */

.dh-panel__footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    font-size: 14px;
    color: var(--dh-text-muted);
}

.dh-panel__footer a {
    color: var(--dh-text-muted);
    text-decoration: none;
}

.dh-panel__footer a:hover {
    text-decoration: underline;
}

.dh-panel__footer-sep {
    color: var(--dh-border);
}

.dh-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------- *
 * OTP verification step
 * The second screen of the same flow, so it reuses the panel, field,
 * button and footer rules above; only these pieces are specific to it.
 * ---------------------------------------------------------------- */

/* Neutral (non-error) banner, e.g. "A new code has been sent". Navy rather than
   green keeps it on the brief's palette. */
.dh-notice {
    margin-bottom: 22px;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--dh-navy);
    background: var(--dh-white);
    border: 1px solid var(--dh-border);
    border-left: 3px solid var(--dh-turquoise);
    border-radius: var(--dh-radius);
}

/* The code field is the single focus of this screen, so it is wider-tracked and
   larger than an ordinary input. text-indent cancels the trailing letter-space
   that would otherwise push the digits left of centre. */
.dh-input--code {
    padding-right: 16px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.45em;
    text-indent: 0.45em;
    text-align: center;
}

.dh-input--code::placeholder {
    font-weight: 400;
    color: var(--dh-border);
}

/* Hide the spinner Firefox/WebKit add to numeric-looking fields. */
.dh-input--code::-webkit-outer-spin-button,
.dh-input--code::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.dh-resend {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: -6px 0 24px;
    font-size: 15px;
    color: var(--dh-text-muted);
}

.dh-resend__action {
    padding: 0;
    font: inherit;
    color: var(--dh-navy);
    font-weight: 600;
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
}

/* While the cooldown runs the control stays in the DOM (so screen readers keep
   following it) but is inert and visibly muted. */
.dh-resend__action[disabled] {
    color: var(--dh-text-muted);
    font-weight: 400;
    cursor: default;
    text-decoration: none;
}

.dh-resend__action:focus-visible {
    outline: 2px solid var(--dh-navy);
    outline-offset: 2px;
}
/* ---------------------------------------------------------------- *
 * Responsive
 * ---------------------------------------------------------------- */

@media (max-width: 1199px) {
    .dh-login__grid {
        grid-template-columns: 1fr 1fr;
    }

    .dh-visual__content {
        padding: 40px 40px 44px;
    }

    .dh-panel {
        padding: 56px 40px 84px;
    }
}

@media (max-width: 899px) {
    .dh-login__grid {
        grid-template-columns: 1fr;
    }

    /* Decorative panel only - dropped rather than stacked, per the brief. */
    .dh-visual {
        display: none;
    }

    .dh-panel {
        justify-content: flex-start;
        padding: 48px 24px 88px;
    }

    .dh-panel__logo {
        display: block;
    }

    .dh-panel__inner {
        max-width: 480px;
    }
}

@media (max-width: 400px) {
    /* Below the reCAPTCHA's own minimum width, so scale the widget as a whole
       instead of letting it overflow the 24px gutters. */
    .dh-captcha__widget {
        transform: scale(0.85);
    }

    .dh-captcha {
        height: 66px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
