﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* Disable text/image selection globally */
* {
    user-select: none;
    -webkit-user-select: none;
}

/* Re-enable for inputs where typing/pasting must work */
input, textarea, [contenteditable] {
    user-select: text;
    -webkit-user-select: text;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    padding: 0;
    margin: 0;
    width: 100%;
}

html, body {
    height: 100%;
    overflow: hidden;
}

main, .page {
    margin: 0;
    padding: 0;
    width: 100%;
}

article {
    height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0 !important;
    margin: 0 !important;
}

.receiver-page-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.receiver-signature-panel {
    flex: 0 0 auto;
}

.receiver-viewer-wrapper {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.dx-blazor-reporting-container {
    height: calc(100vh - 166px) !important;
    width: 100% !important;
}

/* ── Force DevExpress viewer pages into a single centered column ─────────── */
.dxbrv-report-preview-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* ── Annotation signature checkbox overlays ─────────────────────────────── */
.annot-sig-cb-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: "Segoe UI", Arial, sans-serif;
    padding: 0 12px;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.35);
    transition: box-shadow 0.18s, filter 0.18s;
}

.annot-sig-cb-wrapper:hover {
    filter: brightness(1.12);
    box-shadow: 0 4px 14px rgba(44, 62, 80, 0.45);
}

.annot-sig-cb-wrapper--checked {
    background: linear-gradient(135deg, #1a6b2a 0%, #27ae60 100%);
    box-shadow: 0 2px 8px rgba(26, 107, 42, 0.35);
}

.annot-sig-cb-wrapper--checked:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 14px rgba(26, 107, 42, 0.45);
}

.annot-sig-cb {
    display: none;
}

.annot-sig-cb__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    letter-spacing: 0.01em;
}

/* ── Envelope info header ────────────────────────────────────────────────── */
.receiver-info-header {
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.receiver-info-header__gradient {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px 8px;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: #fff;
}

.receiver-info-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.receiver-info-header__icon {
    flex-shrink: 0;
    opacity: .85;
}

.receiver-info-header__title {
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 340px;
}

.receiver-info-header__sender {
    font-size: 0.72rem;
    opacity: .8;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.receiver-info-header__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.receiver-info-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,.18);
    color: #fff;
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 0.70rem;
    font-weight: 500;
    white-space: nowrap;
}

.receiver-info-badge--muted {
    background: rgba(255,255,255,.10);
    opacity: .8;
}

.receiver-info-badge--accent {
    background: rgba(39,174,96,.35);
    border: 1px solid rgba(39,174,96,.5);
}

.receiver-info-message {
    padding: 7px 16px;
    font-size: 0.78rem;
    color: #444;
    border-bottom: 1px solid rgba(0,0,0,.05);
    white-space: pre-wrap;
    line-height: 1.45;
}

.receiver-info-private-message {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 5px 16px 6px;
    font-size: 0.75rem;
    color: #5a5a72;
    background: #f8f7ff;
    border-top: 1px solid rgba(90,80,180,.12);
}

/* ── Signature action bar ────────────────────────────────────────────────── */
.receiver-action-bar {
    border-bottom: 1px solid rgba(0,0,0,.08);
    background: #fff;
}

.receiver-action-bar__inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 7px 14px;
}

.receiver-action-bar__progress {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

/* ── Home page ───────────────────────────────────────────────────────────── */
.home-page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 36px);
    background: linear-gradient(160deg, #1e2e3e 0%, #2c3e50 40%, #3498db 100%);
    padding-bottom: 36px;
}

.home-hero-header {
    width: 100%;
    padding: 48px 24px 36px;
    text-align: center;
}

.home-hero-header__inner {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    color: #fff;
}

.home-hero-header__icon {
    opacity: 0.90;
    flex-shrink: 0;
}

.home-hero-header__title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    letter-spacing: 0.02em;
}

.home-hero-header__subtitle {
    font-size: 0.92rem;
    margin: 4px 0 0;
    color: rgba(255,255,255,0.75);
}

.home-content {
    width: 100%;
    max-width: 520px;
    padding: 0 16px;
}

.home-card {
    border-radius: 12px !important;
    overflow: hidden;
}

.home-btn-primary {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    border: none;
    color: #fff !important;
    font-weight: 700;
    border-radius: 8px;
    transition: filter 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 10px rgba(44,62,80,0.30);
}

.home-btn-primary:hover {
    filter: brightness(1.12);
    box-shadow: 0 4px 16px rgba(44,62,80,0.40);
    color: #fff;
}

.home-feature-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(52,152,219,0.10);
    color: #3498db;
    border: 1px solid rgba(52,152,219,0.25);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Signed result page */
.receiver-signed-result-page {
    min-height: calc(100vh - 36px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(160deg, #1e2e3e 0%, #2c3e50 40%, #3498db 100%);
}

.receiver-signed-result-card {
    width: min(680px, 100%);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
    padding: 2rem 1.5rem;
    text-align: center;
}

.receiver-signed-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    color: #0f8f58;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #86efac;
    margin-bottom: 1rem;
}

.receiver-signed-result-title {
    margin: 0;
    color: #1f2937;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.receiver-signed-result-message {
    margin: 0.85rem auto 0;
    max-width: 58ch;
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.62;
}

[data-sf-theme="purple"] .receiver-signed-result-page {
    background: linear-gradient(160deg, #1a0533 0%, #3b0764 45%, #6b21a8 100%);
}

[data-sf-theme="blazing-dark"] .receiver-signed-result-page {
    background: linear-gradient(160deg, #0a0f1e 0%, #111827 50%, #1e1b4b 100%);
}

[data-sf-theme="blazing-dark"] .receiver-signed-result-card {
    background: rgba(15, 20, 40, 0.94);
    border-color: rgba(129, 140, 248, 0.28);
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.45);
}

[data-sf-theme="blazing-dark"] .receiver-signed-result-title {
    color: rgba(255, 255, 255, 0.92);
}

[data-sf-theme="blazing-dark"] .receiver-signed-result-message {
    color: rgba(255, 255, 255, 0.68);
}

[data-sf-theme="blazing-dark"] .receiver-signed-result-icon {
    color: #86efac;
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(110, 231, 183, 0.35);
}

/* ── Logos ───────────────────────────────────────────────────────────────── */
/* Heights are controlled by inline style="height: Xpx" from appsettings.json */

.signflow-app-logo {
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.signflow-company-logo {
    width: auto;
    object-fit: contain;
    display: block;
    opacity: 0.88;
    flex-shrink: 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.receiver-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;   /* ← left group | right group */
    gap: 10px;
    padding: 0 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.72rem;
    z-index: 100;
    flex-shrink: 0;
}

.receiver-footer a {
    color: rgba(255, 255, 255, 0.90);
    text-decoration: none;
    transition: color 0.15s;
}

.receiver-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.receiver-footer__left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.receiver-footer__sep {
    opacity: 0.4;
}

.receiver-footer__right {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.sf-lang-combo {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.sf-lang-trigger {
    width: 28px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sf-lang-trigger:hover {
    background: rgba(255, 255, 255, 0.16);
}

.sf-lang-menu {
    position: absolute;
    right: 0;
    bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 64px;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(29, 38, 55, 0.98);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 110;
}

.sf-lang-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: default;
    z-index: 105;
}

.sf-lang-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 6px;
    cursor: pointer;
}

.sf-lang-option:hover,
.sf-lang-option--active {
    background: rgba(255, 255, 255, 0.14);
}

.sf-lang-trigger .fi,
.sf-lang-option .fi {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

/* ── Footer: Theme Slider ────────────────────────────────────────────────── */
/* 🌙 blazing-dark ──◇──·──◇── purple ☀️                                     */
/* Left group: copyright | datenschutz  →  Right group: slider               */

.sf-theme-slider {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

/* Moon / Sun SVG icons */
.sf-theme-icon {
    display: block;
    opacity: 0.55;                 /* ↑ was 0.42 — more visible as base */
    flex-shrink: 0;
    transition: opacity 0.18s;
    align-self: center;
}

.sf-theme-icon--active {
    opacity: 0.92;
}

.sf-theme-icon--mid {
    opacity: 0.62;
}

/* ── Wrapper holds the range input + tick marks ───────────────────────────── */
.sf-theme-track-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 80px;
    height: 16px;          /* enough height so ticks + thumb don't clip */
}

/* Actual range input — fills the wrapper */
.sf-theme-range {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    z-index: 1;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 1px;
    outline: none;
    cursor: pointer;
    margin: 0;
    /* no extra padding so ticks align correctly */
}

.sf-theme-range:hover {
    background: rgba(255, 255, 255, 0.42);
}

/* Thumb — white circle */
.sf-theme-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.90);
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
    transition: transform 0.12s, box-shadow 0.12s;
}

.sf-theme-range::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.38);
}

/* Firefox */
.sf-theme-range::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.90);
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

.sf-theme-range::-moz-range-track {
    height: 2px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 1px;
}

/* ── End ticks (left & right): thin vertical bars ────────────────────────── */
.sf-theme-tick {
    position: absolute;
    z-index: 0;
    width: 2px;
    height: 7px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.45);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.sf-theme-tick--left  { left: 0; }
.sf-theme-tick--right { right: 0; }

/* Mid tick — thinner, subtler */
.sf-theme-tick--mid {
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 5px;
    background: rgba(255, 255, 255, 0.50);   /* ↑ was 0.22 */
}

/* Sun icon: always visible regardless of active state */
.sf-theme-icon--sun {
    opacity: 0.72;                            /* minimum visibility */
}

/* ── Theme overrides: Home page & Login ──────────────────────────────────── */
/* selector: [data-sf-theme="<name>"] on <html>, set by signflow-theme.js    */

/* ── Purple ── */
[data-sf-theme="purple"] .home-page-wrapper {
    background: linear-gradient(160deg, #1a0533 0%, #3b0764 45%, #6b21a8 100%);
}

[data-sf-theme="purple"] .home-btn-primary {
    background: linear-gradient(135deg, #6b21a8 0%, #9333ea 100%);
}

[data-sf-theme="purple"] .home-feature-badge {
    background: rgba(147, 51, 234, 0.10);
    color: #c084fc;
    border-color: rgba(147, 51, 234, 0.25);
}

/* Login card header: set via a CSS rule so inline gradient can be overridden */
.login-card .card-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%) !important;
}

[data-sf-theme="purple"] .login-card .card-header {
    background: linear-gradient(135deg, #1a0533 0%, #6b21a8 100%) !important;
}

[data-sf-theme="blazing-dark"] .home-page-wrapper {
    background: linear-gradient(160deg, #0a0f1e 0%, #111827 50%, #1e1b4b 100%);
}

[data-sf-theme="blazing-dark"] .home-btn-primary {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
}

[data-sf-theme="blazing-dark"] .home-feature-badge {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.28);
}

[data-sf-theme="blazing-dark"] .home-card {
    background: rgba(15, 20, 40, 0.92) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-sf-theme="blazing-dark"] .home-card .text-muted {
    color: rgba(255, 255, 255, 0.55) !important;
}

[data-sf-theme="blazing-dark"] .login-card {
    background: rgba(15, 20, 40, 0.95) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-sf-theme="blazing-dark"] .login-card .card-header {
    background: linear-gradient(135deg, #0a0f1e 0%, #1e1b4b 100%) !important;
}

[data-sf-theme="blazing-dark"] .login-card .card-body {
    background: rgba(15, 20, 40, 0.95);
}

[data-sf-theme="blazing-dark"] .login-card .card-footer {
    background: rgba(15, 20, 40, 0.95) !important;
    color: rgba(255, 255, 255, 0.45) !important;
}

[data-sf-theme="blazing-dark"] .login-card .form-label {
    color: rgba(255, 255, 255, 0.75);
}

[data-sf-theme="blazing-dark"] .login-card .form-control,
[data-sf-theme="blazing-dark"] .login-card .input-group-text {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
}

[data-sf-theme="blazing-dark"] .login-card .btn-primary {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%) !important;
    border-color: transparent !important;
}

[data-sf-theme="blazing-dark"] .login-card .text-muted {
    color: rgba(255, 255, 255, 0.50) !important;
}
