/* Добавляем шрифт IgraSans */
@font-face {
    font-family: 'IgraSans';
    src: url('IgraSans.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --color-1: #000000;
    --color-2: #0a0a0a;
    --color-3: #121212;
    --color-4: #1a1a1a;
    --color-5: #222222;
    
    --accent-light: #8e44ad;
    --accent-main: #6c3483;
    --accent-dark: #4a235a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --error: #b5535a;
    --success: #56a58e;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.03); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

@keyframes borderGlow {
    0% { border-color: var(--accent-dark); }
    50% { border-color: var(--accent-light); }
    100% { border-color: var(--accent-dark); }
}

@keyframes floatIn {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 5px rgba(142, 68, 173, 0.2); }
    50% { box-shadow: 0 0 20px rgba(142, 68, 173, 0.5); }
    100% { box-shadow: 0 0 5px rgba(142, 68, 173, 0.2); }
}

@keyframes borderFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

body {
    font-family: 'IgraSans', sans-serif;
    background-color: var(--color-1);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 3rem auto;
    padding: 2rem;
    animation: fadeIn 0.8s ease-out;
    --color: rgba(142, 68, 173, 0.1);
    background-color: #000000;
    background-image: linear-gradient(0deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%, transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%, transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%, transparent);
    background-size: 55px 55px;
}

h1 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    font-weight: 400;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
}

.rate {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.card {
    background-color: rgba(10, 10, 10, 0.8);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: 0 auto 2.5rem;
    max-width: 550px;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-3);
    animation: floatIn 0.8s ease-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(142, 68, 173, 0.3);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent-light), var(--accent-dark));
    background-size: 200% 200%;
    animation: borderFlow 3s ease infinite;
    z-index: 1;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    transform: translateX(0);
    transition: transform 0.3s ease, color 0.3s ease;
}

.form-group:hover label {
    transform: translateX(5px);
    color: var(--accent-light);
}

input {
    width: 100%;
    padding: 1rem 1.2rem;
    background-color: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--color-4);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    font-family: 'IgraSans', sans-serif;
}

input:focus {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 1px rgba(142, 68, 173, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: rgba(25, 25, 25, 0.9);
    transform: scale(1.01);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    position: relative;
}

.input-wrapper input {
    flex: 1;
}

.btn-check {
    padding: 0.9rem 1.5rem;
    background-color: var(--accent-main);
    color: var(--text-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: glowPulse 3s infinite;
}

.btn-check::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: all 0.6s;
}

.btn-check:hover::before {
    left: 100%;
}

.btn-check:hover {
    background-color: var(--accent-light);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2), 0 0 15px rgba(142, 68, 173, 0.4);
}

.btn-check:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 1.8rem;
    background-color: rgba(20, 20, 20, 0.7);
    border-radius: 10px;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
    border-left: 3px solid var(--accent-light);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.user-info:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25), 0 0 10px rgba(142, 68, 173, 0.2);
}

.user-photo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--color-2);
    box-shadow: 0 0 15px rgba(142, 68, 173, 0.4);
    border: 2px solid var(--accent-light);
    animation: borderGlow 3s infinite;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.user-info:hover .user-photo {
    transform: scale(1.1);
}

.user-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1.2rem;
    letter-spacing: 0.3px;
}

.calculation {
    background-color: rgba(20, 20, 20, 0.7);
    padding: 1.8rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border: 1px solid var(--color-4);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.calculation:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 10px rgba(142, 68, 173, 0.2);
}

.calculation::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
}

.calc-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.calc-row:last-child {
    margin-bottom: 0;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(142, 68, 173, 0.2);
    font-weight: 500;
    color: var(--accent-light);
    font-size: 1.2rem;
}

.btn-buy {
    width: 100%;
    padding: 1.3rem;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent-main));
    color: var(--text-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 1px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.btn-buy::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: all 0.6s;
}

.btn-buy:hover:not(:disabled)::before {
    left: 100%;
}

.btn-buy:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-main), var(--accent-light));
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25), 0 0 20px rgba(142, 68, 173, 0.3);
}

.btn-buy:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-buy:disabled {
    background: linear-gradient(135deg, rgba(74, 35, 90, 0.5), rgba(108, 52, 131, 0.5));
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

.payment-info {
    background-color: rgba(10, 10, 10, 0.8);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: fadeIn 0.5s ease-out;
    margin: 0 auto 2.5rem;
    max-width: 550px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-3);
    border-top: 3px solid var(--accent-light);
}

.payment-info h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
}

.payment-info p {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.btn-payment {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent-main));
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    animation: pulse 3s infinite;
}

.btn-payment::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: all 0.6s;
}

.btn-payment:hover::before {
    left: 100%;
}

.btn-payment:hover {
    background: linear-gradient(135deg, var(--accent-main), var(--accent-light));
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25), 0 0 20px rgba(142, 68, 173, 0.3);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    margin-top: auto;
    background-color: var(--color-2);
    border-top: 1px solid var(--color-3);
}

.hidden {
    display: none;
}

.policy-section {
    background-color: rgba(10, 10, 10, 0.8);
    border-radius: 12px;
    padding: 2.5rem;
    margin: 2rem auto;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-3);
    animation: floatIn 0.8s ease-out;
}

.policy-section h2 {
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-block;
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
}

.policy-section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40%;
    height: 1px;
    background: linear-gradient(to right, var(--accent-light), transparent);
}

.policy-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.policy-content p {
    margin-bottom: 1.2rem;
}

.policy-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.2rem;
}

.policy-content li {
    margin-bottom: 0.7rem;
}

.policy-toggle {
    display: flex;
    justify-content: center;
    margin: 1.2rem 0;
}

.policy-btn {
    background: transparent;
    border: none;
    color: var(--accent-light);
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    letter-spacing: 0.3px;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s;
    font-family: 'IgraSans', sans-serif;
}

.policy-btn:hover {
    background-color: rgba(142, 68, 173, 0.1);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease;
}

.accordion-content.active {
    max-height: 1000px;
}

/* Loading animation */
.loading-text {
    position: relative;
    display: inline-block;
}

/* Notification styles */
#notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(142, 68, 173, 0.2);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    backdrop-filter: blur(10px);
    font-family: 'IgraSans', sans-serif;
}

/* Animate-in class for elements */
.animate-in {
    animation: fadeIn 0.5s ease-out;
}

/* Responsiveness */
@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 1rem;
    }
    
    .card, .payment-info, .policy-section {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .payment-info h2, .policy-section h2 {
        font-size: 1.5rem;
    }
    
    .btn-buy, .btn-payment {
        padding: 1rem;
    }
    
    .input-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .button {
        width: 100%;
    }
    
    .user-info {
        padding: 1.2rem;
        gap: 12px;
    }
    
    .user-photo {
        width: 55px;
        height: 55px;
    }
    
    .codepen-button span {
        padding: 0.9rem 1.2rem;
        font-size: 1rem;
    }
}

/* Elegant scroll bar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background-color: var(--color-2);
}

::-webkit-scrollbar-thumb {
    background-color: var(--accent-main);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-light);
}

/* Дополнительные стили для анимаций взаимодействия */
.form-group.focused label {
    color: var(--accent-light);
    transform: translateX(5px);
}

input.has-content {
    border-color: var(--accent-light);
    background-color: rgba(25, 25, 25, 0.9);
}

.card.loading {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(142, 68, 173, 0.4);
}

.card.processing {
    animation: glowPulse 1.5s infinite;
}

.calculation.updated {
    animation: borderGlow 1s;
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.user-info.animate-in {
    animation: fadeInLeft 0.5s ease-out forwards;
}

.payment-info.animate-in {
    animation: fadeInRight 0.5s ease-out forwards;
}

/* Добавляем индикатор загрузки */
.fa-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Новые стили для кнопки Check из UIverse.io */
.button {
  padding: 15px 20px;
  border: none;
  outline: none;
  background-color: #151515;
  color: #eee;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease-out;
  font-family: 'IgraSans', sans-serif;
}

.button:hover {
  transform: translateY(-3px);
}

.button-span {
  color: #aaa;
}

/* Новые стили для кнопки Purchase Stars из UIverse.io */
.codepen-button {
  display: block;
  cursor: pointer;
  color: white;
  margin: 0 auto;
  position: relative;
  text-decoration: none;
  font-weight: 600;
  border-radius: 6px;
  overflow: hidden;
  padding: 3px;
  isolation: isolate;
}

.codepen-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 400%;
  height: 100%;
  background: linear-gradient(115deg,#4fcf70,#fad648,#a767e5,#12bcfe,#44ce7b);
  background-size: 25% 100%;
  animation: an-at-keyframe-css-at-rule-that-translates-via-the-transform-property-the-background-by-negative-25-percent-of-its-width-so-that-it-gives-a-nice-border-animation_-We-use-the-translate-property-to-have-a-nice-transition-so-it_s-not-a-jerk-of-a-start-or-stop .75s linear infinite;
  animation-play-state: paused;
  translate: -5% 0%;
  transition: translate 0.25s ease-out;
}

.codepen-button:hover:not(:disabled)::before {
  animation-play-state: running;
  transition-duration: 0.75s;
  translate: 0% 0%;
}

@keyframes an-at-keyframe-css-at-rule-that-translates-via-the-transform-property-the-background-by-negative-25-percent-of-its-width-so-that-it-gives-a-nice-border-animation_-We-use-the-translate-property-to-have-a-nice-transition-so-it_s-not-a-jerk-of-a-start-or-stop {
  to {
    transform: translateX(-25%);
  }
}

.codepen-button span {
  position: relative;
  display: block;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  background: #000;
  border-radius: 3px;
  height: 100%;
  font-family: 'Playfair Display', serif;
}

.codepen-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.codepen-button:disabled::before {
  background: linear-gradient(115deg,#333,#444,#555,#444,#333);
}

.button-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* Стиль для метки минимального количества звезд */
.min-stars {
  color: var(--accent-light);
  font-size: 0.85rem;
  font-style: italic;
}

/* Улучшенные медиа-запросы для мобильных устройств */
@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 1rem;
    }
    
    .card, .payment-info, .policy-section {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .payment-info h2, .policy-section h2 {
        font-size: 1.5rem;
    }
    
    .btn-buy, .btn-payment {
        padding: 1rem;
    }
    
    .input-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .button {
        width: 100%;
    }
    
    .user-info {
        padding: 1.2rem;
        gap: 12px;
    }
    
    .user-photo {
        width: 55px;
        height: 55px;
    }
    
    .codepen-button span {
        padding: 0.9rem 1.2rem;
        font-size: 1rem;
    }
}

/* Дополнительные оптимизации для очень маленьких экранов */
@media (max-width: 480px) {
    .container {
        padding: 0.8rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .rate {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }
    
    .card, .payment-info, .policy-section {
        padding: 1.2rem;
        border-radius: 8px;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    label {
        font-size: 0.9rem;
    }
    
    input {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
    
    .calculation {
        padding: 1.2rem;
    }
    
    .calc-row {
        font-size: 0.95rem;
    }
    
    .calc-row:last-child {
        font-size: 1.1rem;
    }
    
    .policy-content {
        font-size: 0.85rem;
    }
    
    .policy-section h2 {
        font-size: 1.4rem;
    }
    
    footer {
        font-size: 0.8rem;
        padding: 1.5rem;
    }
    
    .codepen-button span {
        padding: 0.8rem 1.1rem;
        font-size: 0.95rem;
    }
}

/* Стили для тачскрина */
@media (hover: none) {
    .card:hover,
    .calculation:hover,
    .user-info:hover {
        transform: none;
        box-shadow: inherit;
    }
    
    .user-info:hover .user-photo {
        transform: none;
    }
    
    .form-group:hover label {
        transform: none;
    }
    
    input:focus {
        transform: none;
    }
    
    .button:hover,
    .btn-payment:hover {
        transform: none;
    }
    
    .policy-btn:hover {
        background-color: transparent;
    }
    
    /* Улучшаем размер кликабельных элементов для тачскрина */
    .button, 
    .codepen-button span, 
    .policy-btn,
    .btn-payment {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

/* Устраняем проблемы с фиксированным положением на мобильных устройствах */
@supports (-webkit-touch-callout: none) {
    #notification {
        bottom: 40px;
    }
}