/* Страницы оформления заказа и подписки */

.checkout {
  padding-block: clamp(3rem, 8vw, 5.5rem);
  position: relative;
  overflow: hidden;
}

/* Modern Background for Subscription Page */
.checkout--subscription {
  background: radial-gradient(circle at 0% 0%, rgba(42, 211, 255, 0.05), transparent 40%),
              radial-gradient(circle at 100% 0%, rgba(255, 92, 138, 0.05), transparent 40%),
              radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0), transparent 50%);
  background-attachment: fixed; /* Parallax effect */
}

.checkout--subscription::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(42, 211, 255, 0.08), transparent 70%);
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
}

.checkout--subscription::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(255, 92, 138, 0.08), transparent 70%);
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
}

.checkout__container {
  display: grid;
  gap: clamp(2rem, 6vw, 3.5rem);
}

.checkout__header h1 {
  font-size: clamp(2.4rem, 5vw, 3.1rem);
  margin: 1rem 0;
  color: #202231;
}

.checkout__header p {
  font-size: 1.05rem;
  color: rgba(32, 34, 49, 0.7);
  max-width: 640px;
}

/* Layout */
.checkout__layout {
    display: grid;
    gap: 3rem;
    grid-template-columns: 1fr 380px;
    align-items: start;
}

@media (max-width: 960px) {
    .checkout__layout {
        grid-template-columns: 1fr;
    }
}

.checkout__main {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Steps */
.checkout-step {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 32px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.checkout-step:hover {
    box-shadow: 0 30px 60px -12px rgba(0,0,0,0.06);
    border-color: rgba(255, 255, 255, 0.9);
}

.checkout-step__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.checkout-step__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    color: #202231;
    font-weight: 700;
    border-radius: 50%;
    font-size: 1.1rem;
    border: 1.5px solid #202231;
}

.checkout-step h2 {
    font-size: 1.4rem;
    margin: 0;
    color: #202231;
}

/* Box Selector */
.box-selector-list {
  display: grid;
  gap: 1rem;
}

.box-option {
  position: relative;
  cursor: pointer;
}

.box-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.box-option__body {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 24px;
  background: #ffffff;
  border: 2px solid #eff1f5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.box-option:hover .box-option__body {
  border-color: #ffcaea;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.box-option input:checked + .box-option__body {
  background: #ffffff;
  border-color: #ff4f70;
  box-shadow: 0 12px 32px rgba(255, 79, 112, 0.15);
  z-index: 1;
}

.box-option__check {
  width: 28px;
  height: 28px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  color: transparent;
  background: #f9fafb;
  margin-top: 2px;
}

.box-option__check svg {
    width: 16px;
    height: 16px;
    stroke-width: 3px;
}

.box-option input:checked + .box-option__body .box-option__check {
  background: #ff4f70;
  border-color: #ff4f70;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(255, 79, 112, 0.3);
}

.box-option__info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.box-option__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
}

.box-option__title {
  font-weight: 700;
  font-size: 1.2rem;
  color: #111827;
}

.box-option__desc {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.5;
}

.box-option__price {
  font-size: 1.25rem;
  font-weight: 800;
  color: #111827;
}

/* Plan Selector */
.plan-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.plan-card {
    position: relative;
    cursor: pointer;
}

.plan-card input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.plan-card__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 1rem;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px;
    transition: all 0.2s;
    height: 100%;
}

.plan-card input:checked + .plan-card__body {
    background: #fff0f3;
    border-color: #ff4f70;
    box-shadow: 0 8px 24px rgba(255, 79, 112, 0.15);
}

.plan-card__title {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #202231;
    font-weight: 600;
}

.plan-card__price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ff4f70;
    margin-bottom: 0.3rem;
}

.plan-card__note {
    font-size: 0.8rem;
    color: rgba(32, 34, 49, 0.7);
    font-weight: 500;
}

.plan-card__badge {
    position: absolute;
    top: -10px;
    background: var(--color-accent);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Form Fields */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.field--full {
    grid-column: 1 / -1;
}

.field__control {
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
    height: 52px;
    border-radius: 14px;
    padding: 0 1.2rem;
    font-size: 1rem;
    color: var(--cb-ink);
    transition: all 0.2s;
}

.field__control:focus {
    border-color: var(--cb-primary);
    box-shadow: 0 0 0 3px rgba(33, 240, 162, 0.15);
    outline: none;
}

.field__label {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--cb-ink-soft);
    display: block;
}

/* Sidebar */
.sticky-sidebar {
    position: sticky;
    top: 2rem;
}

.summary-card {
    background: rgba(255, 255, 255, 0.85);
    padding: 2rem;
    border-radius: 32px;
    box-shadow: 0 30px 60px -15px rgba(18, 20, 31, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-align: left;
}

.summary-card__title {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    text-align: left;
    color: #202231;
}

/* Selected Box Preview */
.summary-preview {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem;
  background: #f8f9fa;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
  min-height: 80px;
}

.selected-box-preview__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #ffffff;
  color: var(--cb-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.selected-box-preview__icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.8px;
}

.selected-box-preview__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
}

.selected-box-preview__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(32, 34, 49, 0.5);
  font-weight: 700;
  line-height: 1;
}

.selected-box-preview__title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--cb-ink);
  line-height: 1.2;
  margin: 0;
}

.selected-box-preview__plan {
  font-size: 0.9rem;
  color: var(--cb-primary);
  font-weight: 500;
  line-height: 1.3;
}

/* Notification */
.checkout-notification {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem;
    background: rgba(88, 123, 255, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(88, 123, 255, 0.15);
    margin-bottom: 1.5rem;
}

.checkout-notification__icon {
    flex-shrink: 0;
    color: var(--color-accent);
    margin-top: 0.1rem;
}

.checkout-notification p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #000000;
    margin: 0;
    font-weight: 500;
}

.summary-total {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.summary-total__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.summary-total__price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cb-primary);
}

.summary-total__note {
    font-size: 0.85rem;
    color: rgba(32, 34, 49, 0.7);
}

.summary-btn {
    margin-top: 1.5rem;
    width: 100%;
    justify-content: center;
    height: 56px;
    font-size: 1.1rem;
}

.summary-policy {
    margin-top: 1rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Mobile Optimizations */
@media (max-width: 960px) {
    .plan-selector-grid {
        grid-template-columns: 1fr;
    }

    .plan-card__body {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 0.25rem 0.5rem;
        padding: 1.2rem;
        align-items: center;
        text-align: left;
        min-height: auto;
    }

    .plan-card__title {
        grid-column: 1;
        grid-row: 1;
        font-size: 1.05rem;
        font-weight: 700;
        margin: 0;
        width: auto;
        margin-bottom: 0;
    }

    .plan-card__price {
        grid-column: 2;
        grid-row: 1;
        text-align: right;
        font-size: 1.25rem;
        font-weight: 700;
        margin: 0;
        white-space: nowrap;
        position: static;
        transform: none;
        width: auto;
    }

    .plan-card__badge {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
        width: auto;
        margin-top: 0.2rem;
        position: static;
        transform: none;
        display: inline-flex;
    }
    
    .plan-card__note {
        grid-column: 1 / -1;
        grid-row: 3;
        margin: 0;
        margin-top: 0.1rem;
        font-size: 0.85rem;
        color: var(--cb-ink-soft);
        width: auto;
    }
    
    .plan-card--featured .plan-card__body {
        padding-right: 1.2rem;
    }

    .checkout__header h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .box-option__body {
        padding: 1rem;
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .box-option__check {
        align-self: flex-start;
        display: none; /* Hide check on mobile to save space or adjust layout */
    }
    
    /* Show active border clearly on mobile */
    .box-option input:checked + .box-option__body {
        border-width: 2px;
    }
    
    .box-option__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
    
    .box-option__price {
        margin-top: 0.2rem;
    }
}

/* Colors for dark mode prevention */
:root {
    --cb-ink-fixed: #202231;
    --cb-primary-fixed: #ff4f70;
}
