/* =========================================================
   Andahost Core — Estilos frontend
   ========================================================= */

/* ── Variables ── */
:root {
    --ah-primary:      #2563eb;
    --ah-primary-dark: #1d4ed8;
    --ah-success:      #16a34a;
    --ah-warning:      #d97706;
    --ah-danger:       #dc2626;
    --ah-info:         #0891b2;
    --ah-text:         #111827;
    --ah-text-muted:   #6b7280;
    --ah-border:       #e5e7eb;
    --ah-bg:           #f9fafb;
    --ah-white:        #ffffff;
    --ah-radius:       10px;
    --ah-radius-lg:    16px;
    --ah-shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --ah-shadow-lg:    0 4px 6px rgba(0,0,0,.07), 0 10px 40px rgba(0,0,0,.1);
    --ah-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Reset base ── */
.ah-box,
.ah-panel,
.ah-checkout,
.ah-domain-search {
    font-family: var(--ah-font);
    color: var(--ah-text);
    line-height: 1.6;
    box-sizing: border-box;
}

*, *::before, *::after { box-sizing: inherit; }

/* ── Contenedores genéricos ── */
.ah-box {
    background: var(--ah-white);
    border-radius: var(--ah-radius-lg);
    box-shadow: var(--ah-shadow);
    padding: 28px 32px;
    margin: 0 0 24px;
}

/* =========================================================
   ALERTAS
   ========================================================= */
.ah-alert {
    border-radius: var(--ah-radius);
    padding: 14px 18px;
    margin: 0 0 20px;
    font-size: 0.95rem;
}
.ah-alert--success { background: #dcfce7; border: 1px solid #86efac; color: #15803d; }
.ah-alert--error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.ah-alert--info    { background: #e0f2fe; border: 1px solid #7dd3fc; color: #0369a1; }
.ah-alert--warning { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; }
.ah-alert--inline  { display: inline-block; padding: 4px 10px; margin: 0; }
.ah-alert a        { color: inherit; font-weight: 600; }

/* =========================================================
   BOTONES
   ========================================================= */
.ah-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: var(--ah-radius);
    cursor: pointer;
    font-family: var(--ah-font);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    text-decoration: none;
    transition: all .18s ease;
    white-space: nowrap;
}
.ah-btn:focus-visible { outline: 3px solid var(--ah-primary); outline-offset: 2px; }

.ah-btn--primary  { background: var(--ah-primary); color: #fff; }
.ah-btn--primary:hover { background: var(--ah-primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.3); }

.ah-btn--secondary { background: var(--ah-bg); color: var(--ah-text); border: 1px solid var(--ah-border); }
.ah-btn--secondary:hover { background: var(--ah-border); }

.ah-btn--outline  { background: transparent; color: var(--ah-primary); border: 2px solid var(--ah-primary); }
.ah-btn--outline:hover { background: var(--ah-primary); color: #fff; }

.ah-btn--large    { padding: 14px 28px; font-size: 1.05rem; border-radius: 12px; }
.ah-btn--small    { padding: 6px 14px; font-size: 0.85rem; }
.ah-btn--full     { width: 100%; }

.ah-btn:disabled  { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* =========================================================
   BADGES
   ========================================================= */
.ah-badge {
    display: inline-block;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    vertical-align: middle;
}
.ah-badge--success { background: #dcfce7; color: #15803d; }
.ah-badge--error   { background: #fee2e2; color: #991b1b; }
.ah-badge--info    { background: #e0f2fe; color: #0369a1; }
.ah-badge--warning { background: #fef3c7; color: #92400e; }

/* =========================================================
   PANEL DEL CLIENTE
   ========================================================= */
.ah-panel {
    max-width: 900px;
}
.ah-panel__header {
    background: linear-gradient(135deg, var(--ah-primary) 0%, #1e40af 100%);
    color: #fff;
    border-radius: var(--ah-radius-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
}
.ah-panel__header h2 { margin: 0 0 6px; font-size: 1.5rem; }
.ah-panel__header p  { margin: 0; opacity: .85; }

.ah-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.ah-stat-card {
    background: var(--ah-white);
    border: 1px solid var(--ah-border);
    border-radius: var(--ah-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--ah-shadow);
}
.ah-stat-number { display: block; font-size: 2rem; font-weight: 700; color: var(--ah-primary); }
.ah-stat-label  { display: block; font-size: 0.82rem; color: var(--ah-text-muted); margin-top: 4px; }

.ah-section { background: var(--ah-white); border: 1px solid var(--ah-border); border-radius: var(--ah-radius-lg); padding: 24px; margin-bottom: 20px; box-shadow: var(--ah-shadow); }
.ah-section h3 { margin: 0 0 16px; font-size: 1.1rem; }

.ah-empty { text-align: center; padding: 32px; color: var(--ah-text-muted); }
.ah-empty a { color: var(--ah-primary); font-weight: 600; }

.ah-orders-list { display: flex; flex-direction: column; gap: 12px; }
.ah-order-card {
    border: 1px solid var(--ah-border);
    border-radius: var(--ah-radius);
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
}
.ah-order-card--active  { border-left: 4px solid var(--ah-success); }
.ah-order-card--failed  { border-left: 4px solid var(--ah-danger);  }
.ah-order-card--pending { border-left: 4px solid var(--ah-warning);  }
.ah-order-card__domain  { font-weight: 700; }
.ah-order-card__meta    { display: flex; gap: 16px; font-size: 0.88rem; color: var(--ah-text-muted); }
.ah-order-card__status  { font-size: 0.9rem; }
.ah-order-card__date    { white-space: nowrap; }
.ah-order-card__actions { grid-column: 1/-1; }

.ah-quick-actions {}
.ah-actions-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.ah-action-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ah-bg); border: 1px solid var(--ah-border);
    border-radius: var(--ah-radius); padding: 12px 20px;
    text-decoration: none; color: var(--ah-text); font-weight: 500;
    transition: all .15s;
}
.ah-action-btn:hover { background: var(--ah-primary); color: #fff; border-color: var(--ah-primary); }

/* =========================================================
   BÚSQUEDA DE DOMINIOS
   ========================================================= */
.ah-domain-search {}
.ah-domain-search__hero { text-align: center; padding: 8px 0 24px; }
.ah-domain-search__hero h2 { font-size: 1.8rem; margin-bottom: 8px; }
.ah-domain-search__hero p  { color: var(--ah-text-muted); margin-bottom: 24px; }

.ah-search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 10px;
    align-items: stretch;
}
.ah-search-bar--inline { max-width: 100%; margin: 0; }
.ah-search-input-wrap {
    flex: 1;
    display: flex;
    border: 2px solid var(--ah-border);
    border-radius: var(--ah-radius);
    overflow: hidden;
    background: var(--ah-white);
    transition: border-color .2s;
}
.ah-search-input-wrap:focus-within { border-color: var(--ah-primary); }
.ah-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: var(--ah-font);
    background: transparent;
}
.ah-search-tld {
    display: flex;
    align-items: center;
    padding: 0 14px 0 4px;
    font-weight: 700;
    color: var(--ah-primary);
    font-size: 1rem;
}

.ah-domain-result { margin: 20px 0; }
.ah-domain-available, .ah-domain-unavailable {
    background: var(--ah-bg);
    border: 1px solid var(--ah-border);
    border-radius: var(--ah-radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.ah-domain-available  { border-left: 4px solid var(--ah-success); }
.ah-domain-unavailable{ border-left: 4px solid var(--ah-danger);  }
.ah-domain-available__name  { flex: 1; font-size: 1.1rem; }
.ah-domain-available__price { color: var(--ah-text-muted); }
.ah-alternatives { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.ah-domain-options { margin-top: 32px; }
.ah-domain-options h3 { margin-bottom: 16px; }
.ah-domain-options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; }
.ah-option-card {
    background: var(--ah-bg);
    border: 1px solid var(--ah-border);
    border-radius: var(--ah-radius);
    padding: 24px;
    text-align: center;
}
.ah-option-card__icon { font-size: 2rem; display: block; margin-bottom: 10px; }
.ah-option-card h4   { margin: 0 0 8px; }
.ah-option-card p    { color: var(--ah-text-muted); font-size: 0.9rem; margin: 0 0 16px; }

.ah-domain-pricing { margin-top: 32px; }
.ah-price-table { width: 100%; border-collapse: collapse; }
.ah-price-table th, .ah-price-table td { padding: 10px 14px; border-bottom: 1px solid var(--ah-border); text-align: left; }
.ah-price-table thead th { background: var(--ah-bg); font-weight: 600; color: var(--ah-text-muted); font-size: 0.85rem; text-transform: uppercase; }

/* =========================================================
   CHECKOUT
   ========================================================= */
.ah-checkout { max-width: 860px; }
.ah-checkout__form {}
.ah-checkout__section {
    background: var(--ah-white);
    border: 1px solid var(--ah-border);
    border-radius: var(--ah-radius-lg);
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: var(--ah-shadow);
}
.ah-checkout__section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px;
    font-size: 1.15rem;
}
.ah-step-num {
    background: var(--ah-primary);
    color: #fff;
    border-radius: 50%;
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.9rem; font-weight: 700; flex-shrink: 0;
}

/* Planes grid */
.ah-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
    gap: 16px;
}
.ah-plan-card {
    border: 2px solid var(--ah-border);
    border-radius: var(--ah-radius);
    padding: 20px;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    display: block;
}
.ah-plan-card__input { position: absolute; opacity: 0; }
.ah-plan-card:has(input:checked),
.ah-plan-card--selected { border-color: var(--ah-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.ah-plan-card--popular  { border-color: var(--ah-primary); }
.ah-plan-card__badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--ah-primary); color: #fff;
    border-radius: 20px; padding: 2px 12px; font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}
.ah-plan-card__name   { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; }
.ah-plan-card__price  { margin: 0 0 10px; }
.ah-plan-card__amount { font-size: 1.6rem; font-weight: 800; color: var(--ah-primary); }
.ah-plan-card__period { font-size: 0.85rem; color: var(--ah-text-muted); }
.ah-plan-card__desc   { font-size: 0.82rem; color: var(--ah-text-muted); margin: 0; line-height: 1.5; }

/* Domain option tabs */
.ah-domain-options-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.ah-tab {
    border: 2px solid var(--ah-border);
    border-radius: var(--ah-radius);
    padding: 16px;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
    display: block;
}
.ah-tab input { display: none; }
.ah-tab:hover     { border-color: var(--ah-primary); background: #eff6ff; }
.ah-tab--active   { border-color: var(--ah-primary); background: #eff6ff; }
.ah-tab__icon     { display: block; font-size: 1.6rem; margin-bottom: 6px; }
.ah-tab__title    { display: block; font-weight: 700; font-size: 0.92rem; }
.ah-tab__subtitle { display: block; font-size: 0.78rem; color: var(--ah-text-muted); margin-top: 2px; }

.ah-domain-field  { margin-top: 4px; }
.ah-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--ah-text); }
.ah-input {
    display: block; width: 100%;
    border: 2px solid var(--ah-border); border-radius: var(--ah-radius);
    padding: 11px 14px; font-size: 0.97rem; font-family: var(--ah-font);
    transition: border-color .2s; background: var(--ah-white);
}
.ah-input:focus { outline: none; border-color: var(--ah-primary); }
.ah-input--monospace { font-family: 'Courier New', monospace; letter-spacing: .08em; }
.ah-help-text { font-size: 0.83rem; color: var(--ah-text-muted); margin: 8px 0 0; }
.ah-help-text a { color: var(--ah-primary); }

/* Order summary */
.ah-order-summary {
    background: var(--ah-bg);
    border: 1px solid var(--ah-border);
    border-radius: var(--ah-radius);
    padding: 18px 22px;
    margin-bottom: 20px;
}
.ah-order-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--ah-border);
    font-size: 0.95rem;
}
.ah-order-summary__row:last-child { border-bottom: none; }
.ah-order-summary__total { font-size: 1.05rem; }
.ah-order-summary__total strong { font-size: 1.3rem; color: var(--ah-primary); }

.ah-checkout__cta { text-align: center; }
.ah-checkout__disclaimer { font-size: 0.82rem; color: var(--ah-text-muted); margin: 12px 0 0; }

/* =========================================================
   PLANES (standalone)
   ========================================================= */
.ah-hosting-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 24px 0;
}
.ah-plan {
    background: var(--ah-white);
    border: 2px solid var(--ah-border);
    border-radius: var(--ah-radius-lg);
    padding: 28px 24px;
    text-align: center;
    position: relative;
    transition: box-shadow .2s, transform .2s;
}
.ah-plan:hover     { box-shadow: var(--ah-shadow-lg); transform: translateY(-2px); }
.ah-plan--popular  { border-color: var(--ah-primary); }
.ah-plan__badge    { background: var(--ah-primary); color: #fff; border-radius: 20px; padding: 4px 14px; font-size: 0.78rem; font-weight: 700; display: inline-block; margin-bottom: 12px; }
.ah-plan__name     { font-size: 1.2rem; font-weight: 800; margin: 0 0 12px; }
.ah-plan__amount   { font-size: 2rem; font-weight: 800; color: var(--ah-primary); }
.ah-plan__period   { font-size: 0.85rem; color: var(--ah-text-muted); }
.ah-plan__desc     { font-size: 0.85rem; color: var(--ah-text-muted); margin: 12px 0 20px; min-height: 48px; }

/* =========================================================
   LOADERS
   ========================================================= */
.ah-loader         { text-align: center; padding: 24px; color: var(--ah-text-muted); }
.ah-loader-inline  { color: var(--ah-text-muted); font-size: 0.9rem; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 640px) {
    .ah-box,
    .ah-checkout__section,
    .ah-panel__header { padding: 20px 18px; }

    .ah-domain-options-tabs { grid-template-columns: 1fr; }
    .ah-plans-grid          { grid-template-columns: 1fr; }
    .ah-search-bar          { flex-direction: column; }
    .ah-order-card          { grid-template-columns: 1fr; }
    .ah-actions-grid        { flex-direction: column; }
    .ah-stats               { grid-template-columns: repeat(3,1fr); }
}
