/**
 * Download Modal Styles
 *
 * 資料ダウンロードモーダルのスタイル
 *
 * @package Corporate_SEO_Pro
 */

/* ==========================================================================
   Modal Container
   ========================================================================== */
.download-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease;
}

.download-modal.is-active {
    visibility: visible;
    opacity: 1;
}

/* ==========================================================================
   Overlay
   ========================================================================== */
.download-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

/* ==========================================================================
   Modal Content
   ========================================================================== */
.download-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.download-modal.is-active .download-modal-content {
    transform: translateY(0) scale(1);
}

/* ==========================================================================
   Close Button
   ========================================================================== */
.download-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

.download-modal-close span {
    position: absolute;
    width: 16px;
    height: 2px;
    background-color: #6b7280;
    border-radius: 1px;
    transition: background-color 0.2s ease;
}

.download-modal-close span:first-child {
    transform: rotate(45deg);
}

.download-modal-close span:last-child {
    transform: rotate(-45deg);
}

.download-modal-close:hover,
.download-modal-close:focus {
    background: #e5e7eb;
}

.download-modal-close:hover span,
.download-modal-close:focus span {
    background-color: #374151;
}

.download-modal-close:focus {
    outline: 2px solid #00867b;
    outline-offset: 2px;
}

/* ==========================================================================
   Modal Header
   ========================================================================== */
.download-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.download-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 134, 123, 0.1) 0%, rgba(0, 134, 123, 0.05) 100%);
    border-radius: 16px;
}

.download-modal-icon i {
    font-size: 28px;
    color: #00867b;
}

.download-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    line-height: 1.3;
}

/* ==========================================================================
   Description
   ========================================================================== */
.download-modal-description {
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */
.download-form .form-group {
    margin-bottom: 1.25rem;
}

.download-form label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.download-form label .required {
    color: #ef4444;
    margin-left: 2px;
}

.download-form input[type="email"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.download-form input[type="email"]:focus {
    outline: none;
    border-color: #00867b;
    box-shadow: 0 0 0 3px rgba(0, 134, 123, 0.1);
}

.download-form input[type="email"].error {
    border-color: #ef4444;
}

.download-form input[type="email"].error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.download-form .error-message {
    display: block;
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 0.5rem;
    min-height: 1.2em;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */
.download-submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #00867b 0%, #006b61 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}

.download-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #006b61 0%, #005952 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 134, 123, 0.35);
}

.download-submit-btn:focus {
    outline: 2px solid #00867b;
    outline-offset: 2px;
}

.download-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.download-submit-btn i {
    font-size: 1.1rem;
}

.download-submit-btn .btn-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   Privacy Notice
   ========================================================================== */
.download-privacy {
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 1rem 0 0;
    line-height: 1.5;
}

.download-privacy a {
    color: #00867b;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.download-privacy a:hover {
    color: #006b61;
}

/* ==========================================================================
   Success State
   ========================================================================== */
.download-success {
    text-align: center;
    padding: 1rem 0;
}

.download-success .success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: 50%;
}

.download-success .success-icon i {
    font-size: 36px;
    color: #10b981;
}

.download-success h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem;
}

.download-success p {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0 0 1.5rem;
}

.download-close-btn {
    padding: 0.75rem 2rem;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-close-btn:hover {
    background: #e5e7eb;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */
@media (max-width: 480px) {
    .download-modal {
        padding: 16px;
    }

    .download-modal-content {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .download-modal-icon {
        width: 56px;
        height: 56px;
    }

    .download-modal-icon i {
        font-size: 24px;
    }

    .download-modal-header h3 {
        font-size: 1.25rem;
    }

    .download-modal-description {
        font-size: 0.9rem;
    }

    .download-form input[type="email"] {
        padding: 0.75rem 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .download-submit-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px) scale(0.95);
    }
    to {
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .download-modal,
    .download-modal-content,
    .download-submit-btn {
        transition: none;
    }
}

/* Focus visible for keyboard navigation */
.download-modal-close:focus-visible,
.download-submit-btn:focus-visible,
.download-form input:focus-visible {
    outline: 2px solid #00867b;
    outline-offset: 2px;
}

/* Body scroll lock when modal is open */
body.download-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}
