/* =========================================================================
   Hutchinson Applications portal
   Brand Guidelines v1 (May 2021) - same palette and shapes as the desktop launcher.
   ========================================================================= */

:root {
    --green: #94c11f;
    --teal: #075152;
    --emerald: #45b27a;
    --surface: #f6f6f6;
    --teal-deep: #043839;
    --teal-hover: #0a6364;
    --green-text: #368c56;
    --card-border: #e1e6e7;
    --divider: #ecf0f0;
    --text-heading: #075152;
    --text-body: #445253;
    --text-muted: #6f7f80;
    --danger: #c43a2c;

    --font: "Roboto", "Segoe UI", system-ui, sans-serif;
    --cut: 22px;          /* the brand's angled corner */
    --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--surface);
    color: var(--text-body);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); }

/* DevExtreme Fluent theme -> brand teal --------------------------------- */
.dx-widget, .dx-widget input, .dx-widget textarea { font-family: var(--font); }
.dx-button-mode-contained.dx-button-default { background-color: var(--teal); border-color: var(--teal); }
.dx-button-mode-contained.dx-button-default.dx-state-hover,
.dx-button-mode-contained.dx-button-default.dx-state-focused { background-color: var(--teal-hover); border-color: var(--teal-hover); }
.dx-button-mode-contained.dx-button-default.dx-state-active { background-color: var(--teal-deep); }
.dx-button-mode-contained.dx-button-default .dx-button-text { font-weight: 500; font-size: 15px; letter-spacing: .2px; }
.dx-texteditor.dx-editor-outlined.dx-state-focused { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.dx-texteditor.dx-editor-outlined.dx-state-hover { border-color: var(--emerald); }
.dx-checkbox-checked .dx-checkbox-icon { background-color: var(--teal); border-color: var(--teal); }
.dx-checkbox.dx-state-focused .dx-checkbox-icon { border-color: var(--teal); }

/* Layout --------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.panel { flex: 1; min-width: 0; position: relative; }

/* Hero (left brand panel) ---------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(155deg, var(--teal) 0%, var(--teal-deep) 100%);
    display: flex;
    flex-direction: column;
    padding: 44px 42px 36px;
}
.hero--photo {
    width: min(44vw, 560px);
    background:
        linear-gradient(180deg, rgba(4,56,57,.41) 0%, rgba(7,81,82,.69) 38%, rgba(4,56,57,.95) 62%, rgba(4,56,57,.98) 100%),
        url("../img/hero.jpg") 68% center / cover no-repeat;
}
.hero--side { width: 340px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; }

/* Large green brand shape sweeping in from the top right at 45 degrees. */
.hero__shape {
    position: absolute;
    width: 150%;
    aspect-ratio: 1;
    right: -98%;
    top: -82%;
    transform: rotate(45deg);
    border-radius: 48px;
    background: linear-gradient(180deg, rgba(148,193,31,.92), rgba(69,178,122,.92));
    pointer-events: none;
}
.hero--photo .hero__shape { width: 74%; right: -40%; top: -34%; opacity: .9; }
/* Launcher side panel: diamond centred just off the right edge, ~150px down (as in the desktop launcher). */
.hero--side .hero__shape { width: 510px; right: -315px; top: -105px; }
.hero--side .hero__echo { width: 300px; left: -170px; bottom: -150px; }
.hero__echo {
    position: absolute;
    width: 90%;
    aspect-ratio: 1;
    left: -55%;
    bottom: -42%;
    transform: rotate(45deg);
    border-radius: 36px;
    background: rgba(255,255,255,.06);
    pointer-events: none;
}

.hero__logo { position: relative; height: 58px; width: auto; align-self: flex-start; }
.hero__copy { position: relative; margin-top: auto; margin-bottom: 28px; max-width: 420px; }
.hero__rule { width: 46px; height: 4px; border-radius: 2px; background: var(--green); margin-bottom: 22px; }
.hero__kicker { margin: 0; font-size: 22px; font-weight: 300; opacity: .95; }
.hero__title { margin: 6px 0 14px; font-size: 40px; line-height: 1.12; font-weight: 700; letter-spacing: -.3px; }
.hero--photo .hero__title { font-size: 46px; }
.hero__text { margin: 0; font-size: 15px; line-height: 1.5; opacity: .92; }
.hero__meta { position: relative; margin: 14px 0 0; font-size: 12px; opacity: .7; }

/* Signed-in user card */
.user-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(2px);
}
.user-card__avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--green), var(--emerald));
    font-weight: 700; font-size: 15px;
}
.user-card__who { flex: 1; min-width: 0; }
.user-card__name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card__login { font-size: 12px; opacity: .8; }
.user-card__signout button {
    background: none; border: 0; color: #fff; font: inherit; font-size: 13px; font-weight: 500;
    cursor: pointer; padding: 6px 4px; border-radius: 6px;
}
.user-card__signout button:hover, .user-card__signout button:focus-visible { text-decoration: underline; outline: none; }

/* Sign-in panel -------------------------------------------------------- */
.panel--login { background: #fff; display: grid; place-items: center; padding: 40px 24px; }
.signin { width: 100%; max-width: 400px; }
.signin__logo { height: 48px; width: auto; margin-bottom: 34px; }
.signin__title { margin: 0; color: var(--text-heading); font-size: 30px; font-weight: 700; }
.signin__subtitle { margin: 6px 0 28px; color: var(--text-muted); font-size: 14px; }
.field-label { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 500; color: var(--text-body); }
.caps-warning { margin: 6px 0 0; color: #b0740b; font-size: 12px; }
.signin__remember { margin: 18px 0 6px; }
.signin__error {
    margin: 14px 0 0; padding: 10px 12px; border-radius: 8px;
    background: #fbeceb; color: var(--danger); font-size: 13px;
}
.signin__submit { margin-top: 22px; }
.signin__help { margin: 22px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.6; }

/* Launcher panel ------------------------------------------------------- */
.panel--launcher { padding: 44px 48px 72px; }
.launcher-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 30px; }
.launcher-head__title { margin: 0; color: var(--text-heading); font-size: 30px; font-weight: 500; }
.launcher-head__sub { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; }
.launcher-head__sub .dot { margin: 0 8px; }
.launcher-head__search { padding-top: 6px; }

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 22px;
    max-width: 1500px;
}

/* A tile: chamfered card (top-right and bottom-left cut), soft shadow, lifts on hover. */
.tile {
    display: block;
    text-decoration: none;
    color: inherit;
    filter: drop-shadow(0 2px 3px rgba(7,81,82,.08)) drop-shadow(0 6px 14px rgba(7,81,82,.06));
    transition: transform .16s ease, filter .16s ease;
    outline: none;
}
.tile:hover, .tile:focus-visible {
    transform: translateY(-3px);
    filter: drop-shadow(0 4px 6px rgba(7,81,82,.12)) drop-shadow(0 14px 26px rgba(7,81,82,.12));
}
.tile[hidden] { display: none; }

/* Two layers so the hover outline follows the angled corners too:
   .tile__card is the outline (2px, transparent until hover/focus), .tile__inner is the white card
   inside it, cut slightly smaller so the outline is an even 2px all the way round, diagonals included. */
.tile__card {
    display: block;
    padding: 2px;
    background: transparent;
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
    border-radius: var(--radius);
    transition: background-color .16s ease;
}
.tile:hover .tile__card { background-color: rgba(69,178,122,.6); }
.tile:focus-visible .tile__card { background-color: var(--emerald); }

.tile__inner {
    --inner-cut: calc(var(--cut) - 1.2px); /* cut - 2px x (2 - sqrt 2): keeps the diagonal outline 2px thick */
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 192px;
    padding: 18px 18px 14px;
    background: #fff;
    clip-path: polygon(0 0, calc(100% - var(--inner-cut)) 0, 100% var(--inner-cut), 100% 100%, var(--inner-cut) 100%, 0 calc(100% - var(--inner-cut)));
    border-radius: calc(var(--radius) - 2px);
}
/* Faint diagonal brand wedge, bottom right */
.tile__inner::before {
    content: "";
    position: absolute;
    width: 160px; height: 160px;
    right: -80px; bottom: -80px;
    transform: rotate(45deg);
    background: linear-gradient(180deg, rgba(148,193,31,.10), rgba(69,178,122,.10));
    pointer-events: none;
}

.tile__top { display: flex; align-items: center; gap: 14px; }
.tile__icon {
    flex-shrink: 0;
    width: 54px; height: 54px;
    display: grid; place-items: center;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
    border-radius: 8px;
}
.tile__icon img { width: 30px; height: 30px; }
.tile--green .tile__icon, .launching__icon.tile--green { background: linear-gradient(135deg, var(--green), var(--emerald)); }
.tile--teal .tile__icon, .launching__icon.tile--teal { background: linear-gradient(135deg, var(--teal-hover), var(--teal)); }
.tile--emerald .tile__icon, .launching__icon.tile--emerald { background: linear-gradient(135deg, var(--emerald), #2f8f60); }
.tile--deep .tile__icon, .launching__icon.tile--deep { background: linear-gradient(135deg, var(--teal), var(--teal-deep)); }

.tile__heading { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tile__category { font-size: 10.5px; font-weight: 500; letter-spacing: .8px; text-transform: uppercase; color: var(--green-text); }
.tile__name { margin-top: 3px; font-size: 18px; font-weight: 500; color: var(--text-heading); line-height: 1.2; }
.tile__number {
    align-self: flex-start;
    margin-right: 6px;
    min-width: 22px; height: 22px;
    display: grid; place-items: center;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    font-size: 11px; color: var(--text-muted);
}
.tile__desc {
    margin: 14px 0 12px;
    font-size: 13px; line-height: 1.5; color: var(--text-body);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile__foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--divider);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.tile__status { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 7px; }
.tile__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); }
.tile__open {
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--teal);
    color: #fff;
    font-size: 13px; font-weight: 500;
    transition: background .16s ease;
}
.tile__open span { display: inline-block; transition: transform .16s ease; }
.tile:hover .tile__open, .tile:focus-visible .tile__open { background: linear-gradient(90deg, var(--teal-hover), var(--teal)); }
.tile:hover .tile__open span, .tile:focus-visible .tile__open span { transform: translateX(3px); }
.tile.is-opening .tile__open { background: var(--emerald); }

.empty { margin: 60px 0; text-align: center; color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.launcher-foot { position: absolute; left: 48px; bottom: 26px; font-size: 13px; color: var(--text-muted); }
.launcher-foot a { margin-left: 4px; }

/* Launch hand-off page ------------------------------------------------- */
.launching { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.launching__card {
    width: 100%; max-width: 440px; text-align: center;
    background: #fff; padding: 40px 36px 36px;
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(7,81,82,.08);
}
.launching__logo { height: 38px; margin-bottom: 26px; }
.launching__icon {
    width: 64px; height: 64px; margin: 0 auto 18px; display: grid; place-items: center;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
    border-radius: 8px;
}
.launching__icon img { width: 34px; height: 34px; }
.launching h1 { margin: 0 0 8px; color: var(--text-heading); font-size: 22px; font-weight: 500; }
.launching p { margin: 0 0 10px; color: var(--text-muted); font-size: 14px; }
.launching__bar { height: 4px; margin-top: 22px; border-radius: 2px; background: var(--divider); overflow: hidden; }
.launching__bar span {
    display: block; width: 40%; height: 100%; border-radius: 2px;
    background: linear-gradient(90deg, var(--green), var(--emerald));
    animation: sweep 1.1s ease-in-out infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* Responsive ----------------------------------------------------------- */
@media (max-width: 980px) {
    .hero--side { width: 260px; padding: 32px 26px 26px; }
    .hero--side .hero__title { font-size: 32px; }
    .panel--launcher { padding: 32px 28px 72px; }
    .launcher-foot { left: 28px; }
}
@media (max-width: 760px) {
    .shell { flex-direction: column; }
    .hero--photo { width: 100%; min-height: 230px; padding: 26px; }
    .hero--photo .hero__copy { margin-bottom: 0; }
    .hero--photo .hero__title { font-size: 30px; }
    .hero--photo .hero__text { display: none; }
    .hero--side { position: relative; width: 100%; height: auto; padding: 22px; }
    .hero--side .hero__shape { width: 300px; right: -190px; top: -150px; }
    .hero--side .hero__copy { margin: 24px 0 18px; }
    .hero--side .hero__text, .hero--side .hero__meta { display: none; }
    .launcher-head__search, .launcher-head__search .dx-textbox { width: 100% !important; }
    .tile__number { display: none; }
    .keys-hint { display: none; }
}
@media (hover: none) { .keys-hint, .tile__number { display: none; } }
@media (prefers-reduced-motion: reduce) {
    .tile, .tile__open span, .launching__bar span { transition: none; animation: none; }
}
