/* Tokens from src/styles/vars.scss + Button / Card / Text from shared UI kit */

@font-face {
  font-family: 'Graphik LCG';
  src: url('./fonts/GraphikLCG-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Graphik LCG';
  src: url('./fonts/GraphikLCG-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Graphik LCG';
  src: url('./fonts/GraphikLCG-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Graphik LCG';
  src: url('./fonts/GraphikLCG-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-primary: #1f4bea;
  --color-primary-hover: #4368ed;
  --color-secondary: #0f1b42;
  --color-secondary-2: #f2f4fe;
  --color-accent-red: #f66e50;
  --color-accent-dark-green: #0fa873;
  --color-accent-light-green: #32c76a;
  --color-text: #111112;
  --color-border: #e4e8ef;
  --color-grey: #f4f4f9;
  --color-disaccent: #81879e;
  --color-white: #fff;

  --font-main: 'Graphik LCG', system-ui, -apple-system, sans-serif;
  --R-card: 24px;
  --card-padding: 30px;
  --card-bg: #f4f4f9;
  --A-duration: 0.3s;
}

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

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(31, 75, 234, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(15, 27, 66, 0.06), transparent 50%),
    var(--color-grey);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 480px;
  padding: var(--card-padding);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--R-card);
  text-align: center;
  animation: card-in 0.45s ease-out both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  border-radius: 50%;
  animation: icon-pop 0.5s 0.15s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes icon-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.status-icon svg {
  width: 40px;
  height: 40px;
}

.status-icon--success {
  background-color: rgba(50, 199, 106, 0.12);
}

.status-icon--fail {
  background-color: rgba(246, 110, 80, 0.12);
}

.title {
  margin-bottom: 12px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-secondary);
}

.description {
  margin-bottom: 32px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-disaccent);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Button — shared/Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 0 1.5rem;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 150%;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 30px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s linear;
  outline: none;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(31, 75, 234, 0.25);
}

.btn--primary {
  color: var(--color-white);
  background-color: var(--color-primary);
}

.btn--primary:hover {
  background-color: var(--color-primary-hover);
}

.btn--secondary {
  color: var(--color-primary);
  background-color: var(--color-white);
  border-color: var(--color-border);
}

.btn--secondary:hover {
  background-color: rgba(31, 75, 234, 0.08);
  border-color: var(--color-primary);
}

.btn--app {
  position: relative;
  gap: 8px;
  overflow: visible;
}

.btn__hint {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.btn__hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  padding: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  color: var(--color-primary);
  background-color: rgba(31, 75, 234, 0.12);
  border: 1px solid rgba(31, 75, 234, 0.35);
  border-radius: 50%;
  cursor: help;
}

.btn__hint-icon:hover,
.btn__hint-icon:focus-visible {
  color: var(--color-white);
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  outline: none;
}

.btn__tooltip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 10;
  width: max-content;
  max-width: min(260px, calc(100vw - 48px));
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.4;
  color: var(--color-white);
  text-align: center;
  white-space: normal;
  background-color: var(--color-secondary);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 27, 66, 0.18);
  pointer-events: none;
  transform: translateX(-50%);
}

.btn__tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--color-secondary);
}

.btn__hint:hover .btn__tooltip,
.btn__hint:focus-within .btn__tooltip {
  display: block;
}

/* Show/hide states */
.state {
  display: none;
}

body[data-status='success'] .state--success,
body[data-status='fail'] .state--fail {
  display: block;
}

@media (max-width: 600px) {
  :root {
    --card-padding: 20px;
  }

  .title {
    font-size: 22px;
  }

  .description {
    margin-bottom: 24px;
    font-size: 14px;
  }

  .status-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
  }

  .status-icon svg {
    width: 36px;
    height: 36px;
  }

  .btn {
    height: 44px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }

  .btn__tooltip {
    left: auto;
    right: 0;
    transform: none;
  }

  .btn__tooltip::after {
    left: auto;
    right: 3px;
    margin-left: 0;
  }
}
