@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

body {
    font-family: 'Roboto', Arial, sans-serif;
    /* Factory photo background */
    background-color: #87ceeb; /* Fallback if the image fails to load */
    background-image: url('img/bg.jpeg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    color: #333;
}

#snowCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows interaction with elements behind the canvas */
    z-index: -1; /* Place behind other content */
}

/* Animated corner ribbon */
.corner-ribbon {
    position: fixed;
    top: 0;
    right: 0;
    width: 230px;
    height: 230px;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
}

.corner-ribbon span {
    position: absolute;
    display: block;
    width: 345px;
    padding: 10px 0;
    background: linear-gradient(135deg, #ff512f 0%, #dd2476 100%);
    color: #fff;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    right: -80px;
    top: 69px;
    transform: rotate(45deg);
    animation: ribbon-glow 2.5s ease-in-out infinite;
}

.corner-ribbon span::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    animation: ribbon-shine 3s ease-in-out infinite;
}

@keyframes ribbon-glow {
    0%, 100% { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 3px 20px rgba(221, 36, 118, 0.65); }
}

@keyframes ribbon-shine {
    0% { left: -100%; }
    60%, 100% { left: 160%; }
}

@media (max-width: 560px) {
    .corner-ribbon {
        width: 170px;
        height: 170px;
    }

    .corner-ribbon span {
        width: 255px;
        padding: 8px 0;
        font-size: 0.85rem;
        right: -60px;
        top: 51px;
    }
}

.container {
    background-color: #ffffff; /* White container */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 650px;
    width: 100%;
    animation: fadeIn 0.8s ease-out; /* Keep fade-in */
    position: relative; /* Ensure container is above snow canvas */
    z-index: 1; /* Place above snow canvas */
}

/* Brand accent line at the top of the card */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(90deg, #0d6efd 0%, #0a58ca 55%, #1f2a37 100%);
}

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

/* Brand header */
.brand {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e3e9f1;
}

.brand-logo-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 16px;
    background: radial-gradient(circle at 30% 20%, #f7faff 0%, #e8f0fe 100%);
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.12);
}

.brand-logo {
    display: block;
    width: 68px;
    height: 68px;
    object-fit: contain;
}

.brand-text {
    min-width: 0;
}

/* Section headings */
.section-heading {
    margin-bottom: 20px;
    padding-left: 14px;
    border-left: 4px solid #0d6efd;
}

.section-heading h2 {
    margin: 0 0 6px;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: #1f2a37;
}

.section-heading p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #6b7785;
}

/* Предварительный просмотр примеров */
.examples-section {
    padding: 20px;
    margin-bottom: 25px;
    background: linear-gradient(160deg, #eef6ff 0%, #e3f0ff 100%);
    border: 1px solid #b9d7ff;
    border-radius: 10px;
}

.examples-section .section-heading {
    margin-bottom: 16px;
}

.example-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.example-link {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #c7dcff;
    border-radius: 8px;
    background-color: #fff;
    color: #1f2a37;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.example-link:hover {
    border-color: #0d6efd;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
}

.example-preview {
    display: block;
    overflow: hidden;
    aspect-ratio: 8 / 5;
    background-color: #eef4ff;
}

.example-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.35s ease;
}

.example-link:hover .example-preview img {
    transform: scale(1.04);
}

.example-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    font-weight: 600;
    color: #0d6efd;
    transition: background-color 0.2s ease;
}

.example-link:hover .example-caption {
    background-color: #f5f9ff;
}

.example-arrow {
    font-size: 1.05rem;
    line-height: 1;
}

/* Кнопки-переключатели разделов */
.service-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.service-toggle {
    background-color: #fff;
    color: #0d6efd;
    border: 2px solid #0d6efd;
    padding: 13px 16px;
}

.service-toggle:hover,
.service-toggle.active {
    background-color: #0d6efd;
    color: #fff;
}

.service-toggle.active {
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

.service-panel[hidden],
.renew-section[hidden] {
    display: none;
}

.service-panel .section-heading {
    margin-bottom: 20px;
}

@media (max-width: 560px) {
    .examples-section {
        padding: 16px;
    }

    .example-links {
        grid-template-columns: 1fr;
    }

    .service-switcher {
        grid-template-columns: 1fr;
    }
}

h1 {
    margin: 0 0 6px;
    font-weight: 700;
    font-size: 2.1rem;
    line-height: 1.15;
    letter-spacing: -0.5px;
    color: #1f2a37;
}

.subtitle {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.45;
    color: #5b6876;
    font-weight: 400;
}

@media (max-width: 560px) {
    .brand {
        gap: 14px;
        padding-bottom: 16px;
        margin-bottom: 20px;
    }

    .brand-logo-wrap {
        width: 64px;
        height: 64px;
        border-radius: 14px;
    }

    .brand-logo {
        width: 52px;
        height: 52px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .section-heading h2 {
        font-size: 1.15rem;
    }
}

.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 15px;
}

@media (max-width: 560px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
}

input[type="email"],
input[type="url"],
input[type="text"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1rem;
    background-color: #f9f9f9;
    color: #333;
    transition: all 0.3s ease;
}

input::placeholder,
textarea::placeholder {
    color: #888;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.2);
    background-color: #fff;
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #777;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #007bff;
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 90px;
}

button {
    background-color: #007bff; /* Primary blue color */
    color: white;
    padding: 14px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    width: 100%;
    transition: background-color 0.3s ease, transform 0.2s ease;
    letter-spacing: 0.5px;
}

button:hover {
    background-color: #0056b3; /* Darker blue on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.terms-of-service {
    margin-top: 25px;
    padding: 18px;
    background-color: #e9ecef; /* Light gray background for terms */
    border-radius: 8px;
    border-left: 4px solid #007bff; /* Accent border */
    color: #555;
}

.terms-of-service h2 {
    font-size: 1.05rem;
    color: #333;
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 600;
}

.terms-of-service ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.terms-of-service li {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 6px;
}

.terms-of-service p {
    font-size: 0.95rem;
    text-align: center;
    color: #333;
    font-weight: 500;
    margin: 15px 0 0 0;
}

.payment-info {
    margin-top: 25px;
    padding: 18px;
    background-color: #e8f5e9; /* Light green background for payment */
    border-radius: 8px;
    border-left: 4px solid #28a745; /* Green accent border */
    color: #555;
}

.payment-info h2 {
    font-size: 1.05rem;
    color: #333;
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 600;
}

.payment-info p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
    margin: 0 0 10px 0;
}

.payment-info p:last-child {
    margin-bottom: 0;
}

.payment-info a {
    color: #007bff;
    font-weight: 600;
    word-break: break-all;
}

.renew-section {
    margin-top: 25px;
    padding: 18px;
    background-color: #cfe7ff; /* Light gray background for renewal */
    border-radius: 8px;
    border-left: 4px solid #309eff; /* Gray accent border */
    color: #555;
}

.renew-section h2 {
    font-size: 1.05rem;
    color: #333;
    margin-top: 0;
    margin-bottom: 8px;
    font-weight: 600;
}

.renew-intro {
    font-size: 0.95rem;
    color: #555;
    margin: 0 0 15px 0;
}

.renew-section .message {
    margin-top: 15px;
}

.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    animation: fadeIn 0.5s;
    transition: all 0.3s ease-out;
}

.message.success {
    background-color: #d4edda; /* Light green */
    color: #155724; /* Dark green */
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da; /* Light red */
    color: #721c24; /* Dark red */
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #cfe2ff; /* Light blue */
    color: #055160; /* Dark blue */
    border: 1px solid #b6d4fe;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Order total in the form */
.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #e8f5e9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #555;
}

.order-total strong {
    font-size: 1.4rem;
    color: #28a745;
}

/* Payment modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 100%;
    padding: 25px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #999;
    width: auto;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    background: none;
    transform: none;
    box-shadow: none;
    color: #333;
}

.modal h2 {
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.modal-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #e8f5e9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #555;
}

.modal-total strong {
    font-size: 1.4rem;
    color: #28a745;
}

.modal-data {
    margin-bottom: 15px;
}

.modal-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.modal-row:last-child {
    border-bottom: none;
}

.modal-row-label {
    color: #777;
    flex-shrink: 0;
}

.modal-row-value {
    color: #333;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.modal-payment {
    background: #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

.modal-payment p {
    margin: 0 0 8px 0;
}

.modal-payment p:last-child {
    margin-bottom: 0;
}

.modal-payment b {
    color: #333;
}
