/* Общие стили zeKEKS Photo Uploader */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #EF41A2;
    --primary-hover: #D62B89;
    --primary-light: #FCE7F3;
    --secondary-color: #EC4899;
    --success-color: #10B981;
    --success-hover: #059669;
    --error-color: #EF4444;
    --error-hover: #DC2626;
    --warning-color: #F59E0B;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --bg-color: #F9FAFB;
    --card-bg: #FFFFFF;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    color: var(--text-primary);
}

.container {
    width: 100%;
    max-width: 600px;
    position: relative;
    transition: max-width 0.4s ease-in-out;
}

.container.container--wide {
    max-width: 1200px;
}

.card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s ease-out;
}

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

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.logo-svg {
    width: 84px;
    height: auto;
    display: block;
    filter: drop-shadow(0 6px 14px rgba(239, 65, 162, 0.25));
}

h1 {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
}

h2 {
    font-size: 28px;
    text-align: center;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 28px;
}

.contact-subtitle {
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 20px;
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

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

.order-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.order-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

input[type="text"],
input[type="url"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="url"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.input-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-full-width {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

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

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

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

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

.btn-danger:hover {
    background: var(--error-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.3);
}

.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: white;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

.loading-dots-large {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-left: 8px;
}

.loading-dots-large span {
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    animation: blink-large 1.4s infinite both;
}

.loading-dots-large span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots-large span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink-large {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Методы загрузки */
.upload-methods {
    display: grid;
    gap: 16px;
    margin-bottom: 12px;
}

.upload-methods.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.method-card {
    padding: 24px 18px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: rgba(255, 255, 255, 0.75);
}

.method-card:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.method-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.method-card h3 {
    margin-bottom: 8px;
}

.method-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Зона загрузки */
.upload-title {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 8px;
}

.upload-title h2 {
    margin-bottom: 0;
}

.step3-layout {
    display: grid;
    justify-content: center;
    grid-template-columns: minmax(0, 600px);
    gap: 24px;
}

@media (min-width: 901px) {
    .step3-layout.two-columns > .card:first-child {
        display: flex;
        flex-direction: column;
    }

    .step3-layout.two-columns > .card:first-child .drop-zone {
        flex-grow: 1;
        display: flex;
    }
}

.drop-zone {
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.drop-zone-content svg {
    margin-bottom: 16px;
}

.drop-zone-content h3 {
    margin-top: 16px;
    margin-bottom: 8px;
}

.drop-zone-content p {
    color: var(--text-secondary);
    margin: 16px 0;
}

.file-hint {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Список файлов */
.file-list {
    height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-count-badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-hover);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.file-actions {
    display: flex;
    gap: 4px;
}

.file-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.file-action-btn.file-view {
    color: var(--primary-color);
}

.file-action-btn.file-view:hover {
    background-color: var(--primary-light);
}

.file-action-btn.file-remove {
    color: var(--error-color);
}

.file-action-btn.file-remove:hover {
    background: #FEE2E2;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.file-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-info-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.upload-progress {
    margin-top: 24px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

#clearAllBtn {
    flex-shrink: 0;
    white-space: nowrap;
}

#uploadBtn {
    flex-grow: 1;
    min-width: 0;
}

/* Результат проверки ссылки Яндекс.Диска */
.link-check-result {
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-check-result p {
    margin-bottom: 4px;
    text-align: left;
    line-height: 1.5;
}

.link-check-button-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.link-check-result.success {
    background: #D1FAE5;
    color: #065F46;
}

.link-check-result.warning {
    background: #FEF3C7;
    color: #92400E;
}

.link-check-result.error {
    background: #FEE2E2;
    color: #991B1B;
}

/* Обработка */
.processing-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-steps {
    margin-top: 28px;
}

.processing-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: var(--bg-color);
    transition: all 0.3s;
    border: 1px solid transparent;
}

.processing-step.active {
    background: rgba(239, 65, 162, 0.14);
    border-color: rgba(239, 65, 162, 0.35);
    color: #9D174D;
    font-weight: 600;
}

.processing-step.completed {
    background: #D1FAE5;
    border-color: #6EE7B7;
    color: #065F46;
}

.step-icon {
    font-size: 20px;
}

.success-animation,
.error-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.success-info {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.support-link-box {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--primary-light);
}

.support-link-box a {
    color: var(--primary-hover);
    font-weight: 600;
    text-decoration: underline;
}

.error-message {
    padding: 12px 16px;
    background: #FEE2E2;
    color: #991B1B;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    animation: slideUp 0.3s ease-out;
}

.modal-content h3 {
    margin-bottom: 16px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d3748;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.5s ease-out, fadeOut 0.5s ease-in 3.5s forwards;
}

@keyframes slideDown {
    from { top: -100px; opacity: 0; }
    to { top: 20px; opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@media (min-width: 901px) {
    .step3-layout.two-columns {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .card {
        padding: 24px;
        border-radius: 16px;
    }

    h1 { font-size: 28px; }
    h2 { font-size: 24px; }

    .upload-methods,
    .upload-methods.two-cols {
        grid-template-columns: 1fr;
    }

    .modal-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body { padding: 12px; }
    .card { padding: 20px; }
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

@media (orientation: portrait) {
    .desktop-only {
        display: none;
    }
}

.file-list::-webkit-scrollbar { width: 8px; }
.file-list::-webkit-scrollbar-track { background: var(--bg-color); border-radius: 4px; }
.file-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.file-list::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

.consent-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 16px;
    line-height: 1.5;
}

.consent-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

.consent-text a:hover {
    color: var(--primary-hover);
}

.footer-text {
    font-size: 13px;
    color: #4b5563;
    opacity: 0.9;
    text-align: center;
    line-height: 1.7;
}

.footer-text a {
    color: #374151;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-text a:hover {
    color: var(--primary-color);
}

.footer-text .footer-divider {
    opacity: 0.55;
    user-select: none;
}

@media (max-width: 600px) {
    .footer-text {
        font-size: 12px;
    }
    .footer-text .footer-divider {
        display: none;
    }
    .footer-text a {
        display: inline-block;
        margin: 2px 6px;
    }
}

.cookie-consent {
    opacity: 0;
    transform: translate(-50%, 100px);
    pointer-events: none;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;

    position: fixed;
    bottom: 20px;
    left: 50%;
    z-index: 1500;
    width: calc(100% - 40px);
    background: rgba(31, 41, 55, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f9fafb;
    border-radius: 16px;
    padding: 16px 24px;
    box-shadow: var(--shadow-xl);
    max-width: 1100px;
}

.cookie-consent.visible {
    opacity: 1;
    transform: translateX(-50%);
    pointer-events: auto;
}

.cookie-consent-given .cookie-consent {
    display: none;
}

.cookie-consent-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
    }
}

.cookie-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.cookie-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-text a {
    color: #F9A8D4;
    text-decoration: underline;
}
