/* ===================================
   Free Trial Modal - Wide Box Layout
   Premium Security Training Aesthetic
   =================================== */

.free-trial-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s ease;
    padding: 1.5rem;
}

.free-trial-modal.active {
    opacity: 1;
    visibility: visible;
}

.free-trial-modal.is-closing {
    opacity: 0;
    visibility: visible;
}

.free-trial-modal-backdrop {
    position: absolute;
    inset: 0;
    background: #05050b;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.free-trial-modal-container {
    position: relative;
    width: 100%;
    max-width: 820px;
    max-height: calc(100vh - 2.5rem);
    max-height: calc(100dvh - 2.5rem);
    transform: scale(0.9) translateY(30px);
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.free-trial-modal.active .free-trial-modal-container {
    transform: scale(1) translateY(0);
}

.free-trial-modal.is-closing .free-trial-modal-container {
    transform: scale(0.94) translateY(20px);
}

.free-trial-modal-content {
    position: relative;
    background:
        radial-gradient(ellipse 70% 90% at 0% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 70% at 100% 50%, rgba(69, 244, 255, 0.06) 0%, transparent 50%),
        linear-gradient(145deg, rgba(24, 24, 36, 0.98) 0%, rgba(14, 14, 22, 0.99) 100%);
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 28px;
    overflow: hidden;
    max-height: inherit;
    box-shadow:
        0 60px 120px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 100px rgba(168, 85, 247, 0.06),
        0 0 60px rgba(69, 244, 255, 0.04);
}

/* Animated gradient border */
.free-trial-modal-content::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 29px;
    padding: 1.5px;
    background: linear-gradient(
        135deg,
        rgba(168, 85, 247, 0.5) 0%,
        rgba(69, 244, 255, 0.4) 33%,
        rgba(168, 85, 247, 0.3) 66%,
        rgba(69, 244, 255, 0.5) 100%
    );
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderGlowAttack 10s ease-in-out infinite;
    pointer-events: none;
}

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

/* Close button */
.trial-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.84);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.trial-close-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #ef4444;
}

.trial-close-btn:focus-visible {
    outline: 2px solid rgba(69, 244, 255, 0.5);
    outline-offset: 2px;
}

/* Modal Layout - Two Column on Desktop */
.trial-modal-layout {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    min-height: 360px;
    overflow-y: auto;
}

/* Left Column - Branding & Value Props */
.trial-modal-left {
    position: relative;
    padding: 2.5rem 2rem;
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.03) 0%, transparent 60%);
    border-left: 1px solid rgba(255, 255, 255, 0.04);
    order: 2;
    display: flex;
    flex-direction: column;
}

.trial-modal-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.4), rgba(69, 244, 255, 0.3), transparent);
}

/* Compact Header */
.trial-header-compact {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.trial-alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background:
        radial-gradient(circle at center, rgba(168, 85, 247, 0.15) 0%, transparent 70%),
        linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(69, 244, 255, 0.06) 100%);
    border: 1.5px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    color: var(--primary-violet-bright, #d4a5ff);
    flex-shrink: 0;
    animation: none;
}

.trial-alert-icon svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.4));
}

.trial-header-text {
    flex: 1;
    padding-top: 0.25rem;
}

.trial-modal-title {
    font-family: var(--attack-font-display, 'Bricolage Grotesque', 'Space Grotesk', sans-serif);
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    background-image: linear-gradient(135deg, #fff 20%, var(--primary-violet-bright, #d4a5ff) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.trial-modal-hook {
    margin: 0.45rem 0 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.7);
}

/* Value Props - Compact */
.trial-value-props {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.trial-value-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, rgba(30, 30, 46, 0.6) 0%, rgba(22, 22, 34, 0.7) 100%);
    border: 1px solid rgba(168, 85, 247, 0.1);
    border-radius: 14px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.trial-value-item:hover {
    border-color: rgba(168, 85, 247, 0.28);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.06) 0%, rgba(30, 30, 46, 0.7) 100%);
    transform: translateX(2px);
}

.trial-value-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(69, 244, 255, 0.12) 0%, rgba(168, 85, 247, 0.08) 100%);
    border-radius: 11px;
    color: var(--accent-cyan, #06b6d4);
    flex-shrink: 0;
}

.trial-value-icon svg {
    width: 20px;
    height: 20px;
}

.trial-value-text {
    font-family: var(--attack-font-display, 'Bricolage Grotesque', 'Space Grotesk', sans-serif);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.trial-value-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Right Column - Form */
.trial-modal-right {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    order: 1;
}

.trial-form-header {
    margin-bottom: 1.5rem;
}

.trial-form-title {
    font-family: var(--attack-font-display, 'Bricolage Grotesque', 'Space Grotesk', sans-serif);
    font-size: 1.42rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 0.35rem 0;
    background-image: linear-gradient(135deg, #fff 20%, var(--accent-cyan, #06b6d4) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.trial-form-subtitle {
    font-family: var(--attack-font-mono, 'IBM Plex Mono', 'Fira Code', monospace);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-transform: none;
    margin: 0;
    opacity: 0.9;
}

/* Form Section */
.trial-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trial-form-group {
    position: relative;
}

/* Row layout for first/last name fields side by side */
.trial-form-group-row {
    display: flex;
    gap: 0.75rem;
}

.trial-form-group-row .trial-form-field {
    flex: 1;
    min-width: 0;
}

.trial-form-group-row .trial-form-field label {
    display: block;
    font-family: var(--attack-font-mono, 'IBM Plex Mono', 'Fira Code', monospace);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: none;
    margin-bottom: 0.5rem;
}

@media (max-width: 400px) {
    .trial-form-group-row {
        flex-direction: column;
        gap: 1rem;
    }
}

.trial-form-group label {
    display: block;
    font-family: var(--attack-font-mono, 'IBM Plex Mono', 'Fira Code', monospace);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: none;
    margin-bottom: 0.5rem;
}

.trial-form-input {
    width: 100%;
    padding: 0.9rem 1.15rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.35s ease;
}

.trial-form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.trial-form-input:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.5);
    background: rgba(0, 0, 0, 0.5);
    box-shadow:
        0 0 0 4px rgba(168, 85, 247, 0.08),
        0 0 20px rgba(168, 85, 247, 0.1);
}

/* Honeypot fields - hidden from users */
.trial-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    z-index: -1;
}

/* Submit Button */
.trial-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.75rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, var(--primary-violet, #7c3aed) 0%, var(--primary-violet-bright, #d4a5ff) 100%);
    border: none;
    border-radius: 14px;
    font-family: var(--attack-font-display, 'Bricolage Grotesque', 'Space Grotesk', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 6px 20px rgba(168, 85, 247, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.trial-submit-btn::before {
    display: none;
}

.trial-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 8px 22px rgba(168, 85, 247, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.trial-submit-btn:hover::before {
    opacity: 1;
}

.trial-submit-btn:active {
    transform: translateY(-1px);
}

.trial-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.trial-submit-btn svg {
    transition: transform 0.35s ease;
    position: relative;
    z-index: 1;
    width: 20px;
    height: 20px;
}

.trial-submit-btn:hover svg {
    transform: translateX(2px);
}

.trial-submit-btn span {
    position: relative;
    z-index: 1;
}

/* Footer - Compact */
.trial-modal-footer {
    margin-top: 1.25rem;
    text-align: center;
}

.trial-footer-text {
    font-family: var(--attack-font-mono, 'IBM Plex Mono', 'Fira Code', monospace);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.72);
    opacity: 1;
}

.trial-footer-text a {
    color: var(--accent-cyan, #06b6d4);
    text-decoration: none;
    transition: color 0.2s ease;
}

.trial-footer-text a:hover {
    color: var(--accent-cyan-bright, #22d3ee);
}

/* Success State */
.trial-form.submitted .trial-form-group,
.trial-form.submitted .trial-submit-btn {
    display: none;
}

.trial-success-message {
    display: none;
    text-align: center;
    padding: 1rem 0;
}

.trial-form.submitted + .trial-success-message,
.trial-success-message.show {
    display: block;
    animation: successReveal 0.5s ease forwards;
}

@keyframes successReveal {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.trial-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0 auto 0.875rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(6, 182, 212, 0.08) 100%);
    border: 2px solid rgba(34, 197, 94, 0.35);
    border-radius: 50%;
    color: #22c55e;
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.trial-success-title {
    font-family: var(--attack-font-display, 'Bricolage Grotesque', 'Space Grotesk', sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
}

.trial-success-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Responsive: Stack on Mobile ===== */
@media (max-width: 768px) {
    .free-trial-modal-container {
        max-width: 100%;
        max-height: calc(100vh - 2rem);
        max-height: calc(100dvh - 2rem);
    }

    .free-trial-modal {
        align-items: flex-start;
        padding-top: 2rem;
    }

    .trial-modal-layout {
        grid-template-columns: 1fr;
        min-height: auto;
        overflow-y: auto;
    }

    /* Show form first, value props second on mobile */
    .trial-modal-right {
        order: -1;
    }

    .trial-modal-left {
        padding: 1.25rem 1.5rem 1.5rem;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-top: 1px solid rgba(255, 255, 255, 0.04);
    }

    .trial-header-compact {
        margin-bottom: 1.25rem;
    }

    .trial-alert-icon {
        width: 48px;
        height: 48px;
    }

    .trial-alert-icon svg {
        width: 24px;
        height: 24px;
    }

    .trial-modal-title {
        font-size: 1.25rem;
    }

    .trial-value-props {
        gap: 0.6rem;
    }

    .trial-value-item {
        padding: 0.75rem 0.9rem;
    }

    .trial-value-icon {
        width: 36px;
        height: 36px;
    }

    .trial-value-icon svg {
        width: 18px;
        height: 18px;
    }

    .trial-value-text {
        font-size: 0.85rem;
    }

    .trial-modal-right {
        padding: 1.5rem;
    }

    .trial-form-header {
        margin-bottom: 1.25rem;
    }

    .trial-form-title {
        font-size: 1.15rem;
    }

    .trial-form-subtitle {
        font-size: 0.65rem;
    }

    .trial-form {
        gap: 0.85rem;
    }

    .trial-form-input {
        padding: 0.85rem 1rem;
        font-size: 0.92rem;
    }

    .trial-submit-btn {
        padding: 0.95rem 1.5rem;
        font-size: 0.95rem;
    }

    .trial-modal-footer {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .free-trial-modal {
        padding: 1rem;
    }

    .free-trial-modal-container {
        max-height: calc(100vh - 1.25rem);
        max-height: calc(100dvh - 1.25rem);
    }

    .trial-modal-title {
        font-size: 1.1rem;
    }

    .trial-header-compact {
        gap: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .free-trial-modal,
    .free-trial-modal-container,
    .trial-close-btn,
    .trial-submit-btn,
    .trial-value-item,
    .trial-submit-btn svg,
    .trial-alert-icon,
    .free-trial-modal-content::before {
        transition: none !important;
        animation: none !important;
    }
}
