/*
 * Diia Design System — web implementation
 * Based on official brand guidelines (Використання логотипу Дія 2025)
 * and diia-open-source/android-diia + ios-uicomponents
 *
 * Font: e-Ukraine (Regular / Medium / Head)
 * Fonts are loaded from local app/static/fonts/.
 * Run `scripts/download_fonts.sh` to fetch them from the official open-source repo.
 * Fallback: system-ui / sans-serif until fonts are available.
 */

/* ── e-Ukraine font-face declarations ──────────────────────────────────────── */

@font-face {
  font-family: 'e-Ukraine';
  src: url('/static/fonts/e_ukraine_regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'e-Ukraine';
  src: url('/static/fonts/e_ukraine_medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'e-Ukraine Head';
  src: url('/static/fonts/e_ukraine_head_regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Official Diia color tokens ─────────────────────────────────────────────
 * Source: ios-uicomponents AppConstants.swift
 */

:root {
  /* Brand */
  --diia-black:           #000000;
  --diia-white:           #FFFFFF;

  /* Status */
  --diia-green:           #19BE6F;
  --diia-green-light:     #65C680;
  --diia-green-dark:      #008939;
  --diia-yellow:          #FFD600;
  --diia-red:             #EC0312;
  --diia-blue-status:     #BED9F5;

  /* Surfaces */
  --diia-bg-light:        #E2ECF4;   /* empty documents, light page bg */
  --diia-bg-lighter:      #EFF7FE;   /* image placeholder */
  --diia-separator:       #CADDEB;
  --diia-ticker-blue:     #E2F2FE;
  --diia-ticker-gray:     #ECECEC;

  /* Text */
  --diia-text-disabled:   #71767A;
  --diia-text-gray:       #DADADA;

  /* Typography */
  --font-body:    'e-Ukraine', system-ui, -apple-system, sans-serif;
  --font-heading: 'e-Ukraine Head', 'e-Ukraine', system-ui, sans-serif;
}

/* ── Base typography ─────────────────────────────────────────────────────── */

.diia-font {
  font-family: var(--font-body);
}

.diia-heading {
  font-family: var(--font-heading);
}

/* ── Official "Увійти через Дію" button ─────────────────────────────────────
 * Spec: black background, white text + Diia icon, rounded corners
 * Ref: android-diia DiiaBlackButton, brand book p. "партнерська кнопка"
 */

.diia-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: var(--diia-black);
  color: var(--diia-white);
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  cursor: pointer;
  width: 100%;
  min-height: 56px;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.diia-auth-btn:hover {
  opacity: 0.88;
}

.diia-auth-btn:active {
  opacity: 0.75;
  transform: scale(0.98);
}

.diia-auth-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.diia-auth-btn .diia-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

/* ── Diia logo (standalone, for page headers) ───────────────────────────── */

.diia-logo-mark {
  display: inline-block;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.diia-logo-mark--sm {
  width: 32px;
  height: 32px;
}

.diia-logo-mark--lg {
  width: 80px;
  height: 80px;
}

/* ── Diia attribution badge (small "powered by" treatment) ─────────────── */

.diia-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--diia-text-disabled);
}

.diia-badge svg {
  width: 16px;
  height: 16px;
}

/* ── Status chip colours ────────────────────────────────────────────────── */

.diia-status-green  { background: var(--diia-green);  color: #fff; }
.diia-status-yellow { background: var(--diia-yellow); color: #000; }
.diia-status-red    { background: var(--diia-red);    color: #fff; }
