/* ==========================================================================
   COMPANY PROFILE PAGE — HTD Steel (/ho-so-nang-luc/)
   Conditional load: only on is_page('ho-so-nang-luc')
   Uses design tokens from :root in style.css
   Purpose: Lead capture — request company profile PDF
   ========================================================================== */

/* --------------------------------------------------------------------------
   HERO — Dark navy with subtle structural grid pattern
   -------------------------------------------------------------------------- */
.htd-profile-hero {
    position: relative;
    background: var(--htd-navy);
    padding: 72px 0 120px;
    overflow: hidden;
    text-align: center;
}

/* Structural blueprint grid overlay */
.htd-profile-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(7, 116, 187, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(7, 116, 187, 0.08) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

/* Radial glow center */
.htd-profile-hero::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(7, 116, 187, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.htd-profile-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 var(--htd-space-6);
    animation: htdProfileHeroIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.htd-profile-hero__breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--htd-text-sm);
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--htd-space-6);
}

.htd-profile-hero__breadcrumb a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: var(--htd-transition-fast);
}

.htd-profile-hero__breadcrumb a:hover {
    color: var(--htd-primary-light);
}

.htd-profile-hero__breadcrumb svg {
    width: 13px;
    height: 13px;
    opacity: 0.4;
    flex-shrink: 0;
}

.htd-profile-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--htd-space-2);
    background: rgba(7, 116, 187, 0.2);
    border: 1px solid rgba(120, 210, 247, 0.3);
    color: var(--htd-primary-light);
    font-size: var(--htd-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 6px 14px;
    border-radius: var(--htd-radius-full);
    margin-bottom: var(--htd-space-5);
}

.htd-profile-hero__badge svg {
    width: 14px;
    height: 14px;
}

.htd-profile-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 var(--htd-space-5);
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.htd-profile-hero h1 span {
    color: var(--htd-primary-light);
}

.htd-profile-hero__subtitle {
    font-size: var(--htd-text-base);
    color: rgba(255, 255, 255, 0.65);
    margin: 0 auto var(--htd-space-8);
    max-width: 560px;
    line-height: var(--htd-leading-relaxed);
}

/* Value proof row */
.htd-profile-hero__stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--htd-space-10);
    flex-wrap: wrap;
}

.htd-profile-stat {
    text-align: center;
}

.htd-profile-stat__number {
    display: block;
    font-size: var(--htd-text-2xl);
    font-weight: 700;
    color: var(--htd-primary-light);
    font-family: var(--htd-font-mono);
    line-height: 1;
    margin-bottom: 4px;
}

.htd-profile-stat__label {
    font-size: var(--htd-text-xs);
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.htd-profile-stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   MAIN LAYOUT — overlapping card from hero
   -------------------------------------------------------------------------- */
.htd-profile-layout {
    max-width: 1100px;
    margin: -60px auto 0;
    padding: 0 var(--htd-space-6) var(--htd-space-20);
    position: relative;
    z-index: 2;
}

.htd-profile-layout__grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--htd-space-8);
    align-items: start;
}

/* --------------------------------------------------------------------------
   FORM CARD
   -------------------------------------------------------------------------- */
.htd-profile-form-card {
    background: var(--htd-surface);
    border: 1px solid var(--htd-border);
    border-radius: var(--htd-radius-xl);
    box-shadow: var(--htd-shadow-elevated);
    overflow: hidden;
}

.htd-profile-form-card__header {
    background: linear-gradient(135deg, var(--htd-primary) 0%, var(--htd-primary-dark) 100%);
    padding: var(--htd-space-8) var(--htd-space-10);
    position: relative;
    overflow: hidden;
}

.htd-profile-form-card__header::before {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.htd-profile-form-card__header::after {
    content: '';
    position: absolute;
    right: 30px;
    bottom: -40px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
}

.htd-profile-form-card__header-inner {
    position: relative;
    z-index: 1;
}

.htd-profile-form-card__title {
    font-size: var(--htd-text-xl);
    color: #ffffff;
    margin: 0 0 var(--htd-space-2);
    display: flex;
    align-items: center;
    gap: var(--htd-space-3);
}

.htd-profile-form-card__title svg {
    width: 22px;
    height: 22px;
    opacity: 0.9;
}

.htd-profile-form-card__desc {
    font-size: var(--htd-text-sm);
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
    line-height: var(--htd-leading-normal);
}

.htd-profile-form-card__body {
    padding: var(--htd-space-8) var(--htd-space-10);
}

/* Status notice */
.htd-profile-notice {
    padding: var(--htd-space-5) var(--htd-space-6);
    border-radius: var(--htd-radius-md);
    margin-bottom: var(--htd-space-6);
    display: flex;
    align-items: flex-start;
    gap: var(--htd-space-4);
    font-size: var(--htd-text-sm);
}

.htd-profile-notice svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.htd-profile-notice--success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.htd-profile-notice--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.htd-profile-notice--info {
    background: var(--htd-primary-subtle);
    border: 1px solid var(--htd-primary-lighter);
    color: var(--htd-primary-dark);
}

.htd-profile-notice p {
    margin: 0;
    max-width: none;
}

/* Form fields */
.htd-profile-form {
    display: flex;
    flex-direction: column;
    gap: var(--htd-space-5);
}

.htd-profile-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--htd-space-5);
}

.htd-profile-field {
    display: flex;
    flex-direction: column;
    gap: var(--htd-space-2);
}

.htd-profile-field--full {
    grid-column: 1 / -1;
}

.htd-profile-field label {
    font-size: var(--htd-text-sm);
    font-weight: 600;
    color: var(--htd-navy);
}

.htd-profile-field__required {
    color: var(--htd-destructive);
    margin-left: 2px;
}

.htd-profile-field input,
.htd-profile-field select {
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
    padding: 0 16px !important;
    border: 1.5px solid var(--htd-border) !important;
    border-radius: var(--htd-radius-md) !important;
    font-size: var(--htd-text-sm) !important;
    line-height: 46px !important;
    background: var(--htd-bg) !important;
    color: var(--htd-navy) !important;
    transition: var(--htd-transition-fast) !important;
    font-family: var(--htd-font-sans) !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

.htd-profile-field select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    padding-right: 40px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px 16px !important;
    cursor: pointer !important;
}

.htd-profile-field input:focus,
.htd-profile-field select:focus {
    border-color: var(--htd-primary) !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(7, 116, 187, 0.1) !important;
    outline: none !important;
}

.htd-profile-field input::placeholder {
    color: #94a3b8;
    line-height: normal;
}

/* Honeypot */
.htd-profile-honeypot {
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

/* Submit */
.htd-profile-submit-wrap {
    padding-top: var(--htd-space-2);
}

.htd-profile-submit {
    width: 100%;
    padding: 16px 32px;
    font-size: var(--htd-text-base);
    font-weight: 700;
    background: var(--htd-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--htd-radius-md);
    cursor: pointer;
    transition: var(--htd-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--htd-space-3);
    min-height: 54px;
    letter-spacing: -0.01em;
    font-family: var(--htd-font-sans);
}

.htd-profile-submit svg {
    width: 18px;
    height: 18px;
}

.htd-profile-submit:hover {
    background: var(--htd-primary-dark);
    box-shadow: 0 8px 24px rgba(7, 116, 187, 0.35);
    transform: translateY(-2px);
}

.htd-profile-submit:active {
    transform: translateY(0) scale(0.98);
}

.htd-profile-privacy-note {
    font-size: var(--htd-text-xs);
    color: var(--htd-muted-fg);
    text-align: center;
    margin: var(--htd-space-3) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--htd-space-2);
}

.htd-profile-privacy-note svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: var(--htd-success);
}

/* --------------------------------------------------------------------------
   SIDEBAR
   -------------------------------------------------------------------------- */
.htd-profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--htd-space-5);
}

/* What's inside card */
.htd-profile-sidebar-card {
    background: var(--htd-surface);
    border: 1px solid var(--htd-border);
    border-radius: var(--htd-radius-lg);
    padding: 28px 24px;
    box-shadow: var(--htd-shadow-card);
}

.htd-profile-sidebar-card__title {
    font-size: var(--htd-text-base);
    font-weight: 700;
    color: var(--htd-navy);
    margin: 0 0 var(--htd-space-5);
    padding-bottom: var(--htd-space-4);
    border-bottom: 2px solid var(--htd-primary-subtle);
    display: flex;
    align-items: center;
    gap: var(--htd-space-3);
}

.htd-profile-sidebar-card__title svg {
    color: var(--htd-primary);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Profile contents checklist */
.htd-profile-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.htd-profile-checklist li {
    display: flex;
    align-items: flex-start;
    gap: var(--htd-space-3);
    font-size: var(--htd-text-sm);
    color: var(--htd-secondary);
    line-height: var(--htd-leading-normal);
}

.htd-profile-checklist li::before {
    content: '';
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    background: var(--htd-primary);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 11px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Contact sidebar (small) */
.htd-profile-contact-card {
    background: var(--htd-navy);
    border-radius: var(--htd-radius-lg);
    padding: 28px 24px;
    color: rgba(255, 255, 255, 0.85);
}

.htd-profile-contact-card__title {
    font-size: var(--htd-text-sm);
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 var(--htd-space-4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.htd-profile-contact-card p {
    font-size: var(--htd-text-sm);
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 var(--htd-space-5);
    max-width: none;
    line-height: var(--htd-leading-normal);
}

.htd-profile-contact-link {
    display: flex;
    align-items: center;
    gap: var(--htd-space-3);
    font-size: var(--htd-text-sm);
    font-weight: 600;
    color: var(--htd-primary-light);
    text-decoration: none;
    padding: var(--htd-space-3) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--htd-transition-fast);
}

.htd-profile-contact-link:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.htd-profile-contact-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.htd-profile-contact-link:hover {
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   RESPONSIVE — Tablet (≤ 1024px)
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 64em) {
    .htd-profile-hero {
        padding: 60px 0 100px;
    }

    .htd-profile-layout__grid {
        grid-template-columns: 1fr;
        gap: var(--htd-space-6);
    }

    .htd-profile-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--htd-space-5);
    }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — Mobile (≤ 768px)
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 48em) {
    .htd-profile-hero {
        padding: 48px 0 90px;
    }

    .htd-profile-hero__stats {
        gap: var(--htd-space-6);
    }

    .htd-profile-stat-divider {
        display: none;
    }

    .htd-profile-layout {
        margin-top: -40px;
        padding: 0 var(--htd-space-4) var(--htd-space-12);
    }

    .htd-profile-form-card__header,
    .htd-profile-form-card__body {
        padding: var(--htd-space-6);
    }

    .htd-profile-form__row {
        grid-template-columns: 1fr;
        gap: var(--htd-space-4);
    }

    .htd-profile-sidebar {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   ANIMATIONS & VISIBILITY SAFEGUARDS
   -------------------------------------------------------------------------- */
@keyframes htdFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.htd-profile-animate {
    opacity: 1;
    transform: translateY(0);
    animation: htdFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.htd-profile-sidebar .htd-profile-sidebar-card { animation-delay: 100ms; }
.htd-profile-sidebar .htd-profile-contact-card { animation-delay: 200ms; }

@media (prefers-reduced-motion: reduce) {
    .htd-profile-animate,
    .htd-profile-hero__inner {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }
}
