/**
 * Account Page Styles - Billetaxo
 * Mobile-first responsive design with CSS custom properties
 * Extracted from mi-cuenta.php for better maintainability
 * Version: 1.0.0
 */

/* ===== MOBILE-FIRST BASE STYLES ===== */
.account-page {
    min-height: 100vh;
    padding: 0.75rem;
    background: var(--background, #F9FAFB);
}

.account-container {
    max-width: 1100px;
    margin: 0 auto;
}

.account-header {
    margin-bottom: 1.25rem;
    text-align: center;
}

.account-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary, #1E3A8A);
    margin-bottom: 0.25rem;
}

.account-header p {
    color: var(--text-secondary, #6B7280);
    font-size: 0.8125rem;
}

/* Grid Principal - Mobile-first: 1 columna base */
.account-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ===== SISTEMA DE CARDS PREMIUM - HEADER/BODY/ACCIONES ===== */
.account-page .account-card {
    background: var(--surface, white);
    border-radius: var(--radius-lg, 0.75rem);
    padding: 0;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1));
    overflow: hidden;
}

.account-page .account-card__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(249, 250, 251, 0.5), transparent);
}

.account-page .account-card__header h2,
.account-page .account-card__header h3,
.account-page .account-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary, #1E3A8A);
    margin: 0;
    letter-spacing: -0.01em;
}

.account-page .account-card__body {
    padding: 1.25rem;
}

.account-page .account-card:not(:has(.account-card__header)) {
    padding: 1.25rem;
}

.account-page .account-card:not(:has(.account-card__header)) h2 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary, #1E3A8A);
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
}

/* ===== PERFIL SUMMARY (NO FORMULARIO) ===== */
.account-page .profile-summary {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0;
}

.account-page .profile-summary__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #1E3A8A) 0%, var(--secondary, #22D3EE) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--surface, white);
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.15);
}

.account-page .profile-summary__info {
    flex: 1;
    min-width: 0;
}

.account-page .profile-summary__name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #1F2937);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.account-page .profile-summary__email {
    font-size: 0.8125rem;
    color: var(--text-secondary, #6B7280);
    margin: 0 0 0.75rem 0;
    word-break: break-all;
}

.account-page .profile-summary__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.account-page .profile-summary__member-since {
    font-size: 0.75rem;
    color: var(--text-secondary, #6B7280);
    padding: 0.25rem 0.5rem;
    background: var(--background, #F9FAFB);
    border-radius: var(--radius-sm, 6px);
}

.account-page .profile-summary__points-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.account-page .points-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, var(--primary, #1E3A8A) 0%, var(--secondary, #22D3EE) 100%);
    color: var(--surface, white);
    border-radius: var(--radius-md, 8px);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.2);
}

.account-page .points-exchange-btn {
    padding: 0.375rem 0.875rem;
    background: var(--surface, white);
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: var(--radius-md, 8px);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary, #1E3A8A);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.account-page .points-exchange-btn:hover {
    background: var(--primary, #1E3A8A);
    color: var(--surface, white);
    border-color: var(--primary, #1E3A8A);
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.15);
}

/* ===== PROFILE CARD SYSTEM (Refactored) - SCOPED ===== */
.account-page .profile-card {
    background: var(--surface, white);
    border-radius: var(--radius-lg, 0.75rem);
    padding: 0;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
    overflow: hidden;
}

.account-page .profile-card__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(249, 250, 251, 0.5), transparent);
}

.account-page .profile-card__header h2 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary, #1E3A8A);
    margin: 0;
    letter-spacing: -0.01em;
}

.account-page .profile-card__header-actions {
    display: flex;
    gap: 0.5rem;
}

.account-page .profile-card__edit-btn {
    padding: 0.375rem 0.75rem;
    background: var(--surface, white);
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: var(--radius-md, 8px);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary, #1E3A8A);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.account-page .profile-card__edit-btn:hover {
    background: var(--primary, #1E3A8A);
    color: var(--surface, white);
    border-color: var(--primary, #1E3A8A);
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.15);
}

.account-page .profile-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Profile Grid - Mobile-first: 1 columna base, 2 columnas desde 640px */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .profile-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.875rem;
    }
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.profile-field__label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary, #6B7280);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
}

.profile-field__label-badge {
    font-size: 0.6875rem;
    color: var(--info, #3B82F6);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs, 0.25rem);
}

.profile-field__control {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm, 0.5rem);
}

.profile-field__input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: var(--radius-md, 8px);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: var(--surface, white);
    color: var(--text-primary, #1F2937);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04));
    min-height: 44px;
    line-height: 1.5;
}

.profile-field__input:hover:not(:disabled) {
    border-color: var(--primary, #1E3A8A);
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.08);
}

.profile-field__input:focus {
    outline: none;
    border-color: var(--primary, #1E3A8A);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.profile-field__input:disabled {
    background-color: var(--background, #F9FAFB);
    cursor: not-allowed;
    border-color: var(--border-light, #D1D5DB);
    color: var(--text-secondary, #6B7280);
}

/* ===== PROFILE VIEW MODE - Premium Layout ===== */
.account-page .profile-view {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.account-page .profile-field {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
}

.account-page .profile-field--full {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
}

.account-page .profile-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary, #6B7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.account-page .profile-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary, #1F2937);
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.account-page .profile-value--mono {
    font-family: ui-monospace, 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-secondary, #6B7280);
}

.profile-field__display {
    flex: 1;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
    background: transparent;
    color: var(--text-primary, #1F2937);
    display: flex;
    align-items: center;
    gap: var(--space-sm, 0.5rem);
    font-weight: 500;
    border: none;
    min-height: 44px;
}

.profile-field__icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.profile-field__edit-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-secondary, #9CA3AF);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: var(--radius-sm, 6px);
    width: 36px;
    height: 36px;
    opacity: 0.7;
}

.profile-field__edit-btn:hover {
    background-color: var(--hover-bg, #F3F4F6);
    color: var(--primary, #1E3A8A);
    opacity: 1;
}

.profile-field--locked .profile-field__display {
    background: var(--background, #F9FAFB);
    border-color: var(--border-color, #E5E7EB);
    opacity: 0.75;
}

.profile-field--locked .profile-field__edit-btn {
    display: none !important;
}

/* Forzar ocultar lápices cuando data-verified="true" */
.profile-field[data-verified="true"] .profile-field__edit-btn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* VIEW MODE: Mostrar display, ocultar inputs */
.profile-field--view .profile-field__display {
    display: flex;
}

.profile-field--view .profile-field__input {
    display: none !important;
}

.profile-field--view .phone-select-group {
    display: none !important;
}

.profile-field--view .country-select {
    display: none !important;
}

/* EDIT MODE: Ocultar display, mostrar inputs */
.profile-field--editing .profile-field__display {
    display: none !important;
}

.profile-field--editing .profile-field__input {
    display: block !important;
}

.profile-field--editing .phone-select-group {
    display: flex !important;
}

.profile-field--editing .country-select {
    display: block !important;
}

/* Phone field editing - show phone-select-group wrapper */
.profile-field--editing .phone-select-group {
    display: flex !important;
}

.profile-field:not(.profile-field--editing) .phone-select-group {
    display: none !important;
}

/* Country field editing - show country select */
.profile-field--editing .country-select {
    display: block !important;
}

.profile-field:not(.profile-field--editing) .country-select {
    display: none !important;
}

/* Hide edit button when in editing mode */
.profile-field--editing .profile-field__edit-btn {
    display: none;
}

.profile-actions {
    display: flex;
    gap: 0.625rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color, #E5E7EB);
    margin-top: 0;
    background: linear-gradient(to top, rgba(249, 250, 251, 0.5), transparent);
}

.profile-actions--hidden {
    display: none;
}

.profile-actions__btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.profile-actions__btn--primary {
    background: linear-gradient(135deg, #1E3A8A 0%, #22D3EE 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
}

.profile-actions__btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.profile-actions__btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-actions__btn--secondary {
    background: #F3F4F6;
    color: #1F2937;
    border: 1px solid #E5E7EB;
}

.profile-actions__btn--secondary:hover {
    background: #E5E7EB;
}

/* ===== SCOPED FORM STYLES (dentro de .account-page) ===== */
.account-page .form-group {
    margin-bottom: 0.625rem;
}

.account-page .form-label {
    display: block;
    margin-bottom: var(--space-xs, 0.25rem);
    font-weight: 600;
    color: var(--text-primary, #1F2937);
    font-size: 0.75rem;
}

.account-page .form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: var(--radius-md, 8px);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: var(--surface, white);
    color: var(--text-primary, #1F2937);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04));
}

.account-page .form-input:hover {
    border-color: var(--primary, #1E3A8A);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.1);
}

.account-page .form-input:focus {
    outline: none;
    border-color: var(--primary, #1E3A8A);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.account-page .form-input:disabled,
.account-page .form-input[readonly] {
    background-color: var(--background, #F9FAFB);
    cursor: default;
    border-color: var(--border-light, #D1D5DB);
    color: var(--text-secondary, #4B5563);
}

/* Estilos modernos para campos con banderas */
.account-page .field-with-flag {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 0.5rem);
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: var(--radius-md, 8px);
    background: var(--background, #F9FAFB);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04));
}

.account-page .field-with-flag:hover {
    border-color: var(--primary, #1E3A8A);
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.08);
}

.account-page .field-flag {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.account-page .field-value {
    flex: 1;
    color: var(--text-primary, #1F2937);
    font-weight: 500;
    letter-spacing: 0.01em;
}

.account-page .field-code {
    color: var(--text-secondary, #6B7280);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--hover-bg, #F3F4F6);
    padding: var(--space-xs, 0.25rem) var(--space-sm, 0.5rem);
    border-radius: var(--radius-sm, 4px);
}

/* Boton de editar pequeno */
.account-page .edit-field-btn {
    background: none;
    border: none;
    color: var(--text-secondary, #6B7280);
    cursor: pointer;
    padding: var(--space-xs, 0.25rem) var(--space-sm, 0.5rem);
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs, 0.25rem);
    transition: all 0.2s ease;
    border-radius: var(--radius-sm, 4px);
    margin-left: var(--space-sm, 0.5rem);
}

.account-page .edit-field-btn:hover {
    background-color: var(--hover-bg, #F3F4F6);
    color: var(--primary, #1E3A8A);
}

.account-page .edit-field-btn:active {
    transform: scale(0.95);
}

/* Contenedor de campo con boton de editar */
.account-page .field-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 0.5rem);
}

.account-page .field-container .form-input,
.account-page .field-container .field-with-flag {
    flex: 1;
}

/* Modo edicion */
.account-page .field-editing .field-with-flag {
    display: none;
}

.account-page .field-editing .form-input {
    display: block;
}

.account-page .field-viewing .form-input {
    display: none;
}

.account-page .field-viewing .field-with-flag {
    display: flex;
}

/* Campo bloqueado (usuario verificado) */
.account-page .field-locked {
    opacity: 0.7;
}

.account-page .field-locked .field-with-flag {
    display: flex;
}

.account-page .field-locked .form-input {
    display: none;
}

.account-page .field-locked .edit-field-btn {
    display: none !important;
}

/* Boton primario - SCOPED */
.account-page .btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary, #1E3A8A) 0%, var(--secondary, #22D3EE) 100%);
    color: var(--surface, white);
    border: none;
    border-radius: var(--radius-md, 8px);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
    width: 100%;
}

.account-page .btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.account-page .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Coming soon placeholder - SCOPED */
.account-page .coming-soon {
    text-align: center;
    padding: var(--space-xl, 3rem) var(--space-lg, 2rem);
    color: var(--text-secondary, #6B7280);
}

.account-page .coming-soon-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md, 1rem);
    opacity: 0.5;
}

.account-page .coming-soon h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary, #4B5563);
    margin-bottom: var(--space-sm, 0.5rem);
}

.account-page .coming-soon p {
    font-size: 0.875rem;
}

/* Tabla de recargas - SCOPED */
.account-page .recharge-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

.account-page .recharge-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    margin-top: var(--space-md, 1rem);
}

.account-page .recharge-table thead {
    background: var(--hover-bg, #F3F4F6);
}

.account-page .recharge-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-secondary, #4B5563);
    border-bottom: 2px solid var(--border-color, #E5E7EB);
    white-space: nowrap;
}

.account-page .recharge-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
    font-size: 0.8125rem;
    color: var(--text-primary, #1F2937);
}

.account-page .recharge-table tbody tr:hover {
    background: var(--background, #F9FAFB);
}

.account-page .recharge-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status badges - SCOPED */
.account-page .status-badge {
    display: inline-block;
    padding: var(--space-xs, 0.25rem) 0.75rem;
    border-radius: var(--radius-lg, 12px);
    font-size: 0.75rem;
    font-weight: 600;
}

.account-page .status-badge.pendiente {
    background: var(--warning-light, #FEF3C7);
    color: var(--warning-dark, #92400E);
}

.account-page .status-badge.procesando {
    background: var(--info-light, #DBEAFE);
    color: var(--info-dark, #1E40AF);
}

.account-page .status-badge.completada {
    background: var(--success-light, #D1FAE5);
    color: var(--success-dark, #065F46);
}

.account-page .status-badge.fallida {
    background: var(--error-light, #FEE2E2);
    color: var(--error-dark, #991B1B);
}

.account-page .status-badge.cancelada {
    background: var(--hover-bg, #F3F4F6);
    color: var(--text-secondary, #4B5563);
}

.account-page .recharge-empty {
    text-align: center;
    padding: var(--space-xl, 3rem) var(--space-lg, 2rem);
    color: var(--text-secondary, #6B7280);
}

.account-page .recharge-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md, 1rem);
    opacity: 0.5;
}

/* ===== RECHARGE CARDS (Mobile responsive) ===== */
.account-page .recharge-cards {
    display: none;
}

.account-page .recharge-card {
    background: var(--surface, white);
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: var(--radius-md, 8px);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.account-page .recharge-card:last-child {
    margin-bottom: 0;
}

.account-page .recharge-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.account-page .recharge-card__date {
    font-size: 0.75rem;
    color: var(--text-secondary, #6B7280);
}

.account-page .recharge-card__destination {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #1F2937);
    margin-bottom: 0.5rem;
}

.account-page .recharge-card__amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-page .recharge-card__price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary, #1E3A8A);
}

.account-page .recharge-card__price-secondary {
    font-size: 0.75rem;
    color: var(--text-secondary, #6B7280);
    font-weight: 400;
}

/* Mobile: Show cards, hide table */
@media (max-width: 639px) {
    .account-page .recharge-cards {
        display: block;
    }

    .account-page .recharge-table-wrapper {
        display: none;
    }
}

/* Desktop: Show table, hide cards */
@media (min-width: 640px) {
    .account-page .recharge-cards {
        display: none;
    }

    .account-page .recharge-table-wrapper {
        display: block;
    }
}

/* Estilos modernos para grupo de telefono */
.phone-select-group {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.75rem;
    align-items: stretch;
}

@media (max-width: 640px) {
    .phone-select-group {
        grid-template-columns: 1fr;
    }
}

.phone-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

/* Estilos modernos para selects */
.phone-code-select,
.country-select {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: var(--radius-md, 8px);
    background: var(--surface, white);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #1F2937);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231F2937' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
    padding-right: 2.25rem;
}

.phone-code-select:hover,
.country-select:hover {
    border-color: var(--primary, #1E3A8A);
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.08);
}

.phone-code-select:focus,
.country-select:focus {
    outline: none;
    border-color: var(--primary, #1E3A8A);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.phone-code-select {
    width: 100%;
    min-width: 160px;
    flex-shrink: 0;
}

.country-select {
    width: 100%;
}

.phone-code-select option,
.country-select option {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    background: white;
    color: #1F2937;
}

/* Estilos mejorados para input de telefono */
#profile-phone {
    padding: 0.625rem 0.75rem;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1F2937;
    transition: all 0.2s ease;
    background: white;
}

#profile-phone:hover {
    border-color: #1E3A8A;
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.08);
}

#profile-phone:focus {
    outline: none;
    border-color: #1E3A8A;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

#profile-phone:invalid:not(:placeholder-shown) {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.recharge-loading {
    text-align: center;
    padding: 2rem;
    color: #6B7280;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.message.success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 3px solid #10B981;
}

.message.error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 3px solid #EF4444;
}

.not-logged-in {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.not-logged-in h2 {
    font-size: 1.5rem;
    color: #1F2937;
    margin-bottom: 1rem;
}

.not-logged-in p {
    color: #6B7280;
    margin-bottom: 2rem;
}

/* Modal para editar ruta - SCOPED */
.account-page .modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.account-page .modal-overlay.active {
    display: flex;
}

.account-page .modal-content {
    background: var(--surface, white);
    border-radius: var(--radius-lg, 12px);
    padding: 1.25rem;
    max-width: 450px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.account-page .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md, 1rem);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
}

.account-page .modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #1F2937);
    margin: 0;
}

.account-page .modal-close {
    background: none;
    border: none;
    font-size: 1.375rem;
    cursor: pointer;
    color: var(--text-secondary, #6B7280);
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.account-page .modal-close:hover {
    color: var(--text-primary, #1F2937);
    background: var(--hover-bg, #F3F4F6);
    border-radius: var(--radius-sm, 6px);
}

.account-page .modal-actions {
    display: flex;
    gap: 0.625rem;
    margin-top: var(--space-md, 1rem);
    justify-content: flex-end;
}

.btn-secondary {
    padding: 0.625rem 1.25rem;
    background: #F3F4F6;
    color: #1F2937;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #E5E7EB;
}

/* Campos de nombre y apellido - Mobile-first: 1 columna base */
.name-fields-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.625rem;
}

/* ===== BREAKPOINTS MOBILE-FIRST ===== */

/* 320px - Movil muy pequeno: compactar padding */
@media (max-width: 374px) {
    .account-page {
        padding: 0.5rem;
    }

    .account-card {
        padding: 0.875rem;
        border-radius: var(--radius-md, 0.5rem);
    }

    .account-header h1 {
        font-size: 1.25rem;
    }

    .account-header p {
        font-size: 0.75rem;
    }

    .form-input,
    .profile-field__input,
    .profile-field__display {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }

    .btn-primary {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .recharge-table {
        min-width: 450px;
    }
}

/* 375px+ - Movil estandar: estilos base normales */
@media (min-width: 375px) {
    .account-page {
        padding: 0.75rem;
    }

    .account-card {
        padding: 1.25rem;
    }

    .form-input,
    .profile-field__input,
    .profile-field__display {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* 480px+ - Movil grande: mejorar espaciados */
@media (min-width: 480px) {
    .account-page {
        padding: 1rem;
    }

    .account-header h1 {
        font-size: 1.5rem;
    }

    .account-card {
        padding: 1.5rem;
    }

    .profile-card {
        padding: 1.5rem;
    }
}

/* 640px+ - Tablet pequena: 2 columnas en profile-grid y name-fields */
@media (min-width: 640px) {
    .profile-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .name-fields-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .phone-select-group {
        grid-template-columns: 160px 1fr;
    }

    .modal-content {
        max-width: 500px;
    }

    .recharge-table {
        min-width: 550px;
    }

    .recharge-table th,
    .recharge-table td {
        padding: 0.875rem;
        font-size: 0.875rem;
    }
}

/* 768px+ - Tablet: mejorar layout general */
@media (min-width: 768px) {
    .account-page {
        padding: 1.5rem;
    }

    .account-header {
        margin-bottom: 1.5rem;
    }

    .account-header h1 {
        font-size: 1.75rem;
    }

    .account-header p {
        font-size: 0.9375rem;
    }

    .account-card {
        padding: 1.75rem;
    }

    .recharge-table {
        min-width: auto;
    }

    .recharge-table th,
    .recharge-table td {
        padding: 1rem;
    }
}

/* 1024px+ - Desktop: 2 columnas en account-grid */
@media (min-width: 1024px) {
    .account-page {
        padding: 2rem;
    }

    .account-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .account-header h1 {
        font-size: 2rem;
    }

    .account-card {
        padding: 2rem;
    }

    .profile-card {
        padding: 2rem;
    }

    .modal-content {
        max-width: 550px;
    }
}

/* Estilos adicionales responsive para componentes especificos */
@media (max-width: 639px) {
    .phone-select-group {
        grid-template-columns: 1fr;
    }

    .modal-overlay {
        padding: 0.5rem;
    }

    .modal-content {
        padding: 1rem;
        max-width: 100%;
        border-radius: var(--radius-lg, 0.75rem);
    }

    .points-badge,
    .points-exchange-badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .profile-field__edit-btn {
        width: 32px;
        height: 32px;
    }

    .profile-actions__btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* ===== RESET PASSWORD FORM - Premium Layout ===== */
.account-page .account-card--password {
    margin-top: 1.5rem;
}

.account-page .reset-description {
    color: var(--text-secondary, #6B7280);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.account-page .reset-form {
    display: flex;
    gap: 0.625rem;
    align-items: center;
}

.account-page .reset-input {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #E5E7EB);
    border-radius: var(--radius-md, 8px);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary, #1F2937);
    background: var(--surface, white);
    transition: all 0.2s ease;
}

.account-page .reset-input:focus {
    outline: none;
    border-color: var(--primary, #1E3A8A);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.account-page .reset-btn {
    flex: 0 0 auto;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary, #1E3A8A) 0%, var(--secondary, #22D3EE) 100%);
    color: var(--surface, white);
    border: none;
    border-radius: var(--radius-md, 8px);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.15);
}

.account-page .reset-btn:hover {
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.25);
    transform: translateY(-1px);
}

.account-page .reset-btn:active {
    transform: translateY(0);
}

.account-page .reset-message {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md, 8px);
    font-size: 0.875rem;
    line-height: 1.5;
}

.account-page .reset-message.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.account-page .reset-message.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

/* Reset form responsive: móvil pequeño */
@media (max-width: 374px) {
    .account-page .reset-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .account-page .reset-input {
        width: 100%;
    }
    
    .account-page .reset-btn {
        width: 100%;
    }
}

/* ===== ESTILOS PARA LISTA DE CONTACTOS ===== */
.account-contacts-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.account-contact-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.account-contact-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.account-contact-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f2937;
}

.account-contact-phone {
    font-size: 0.85rem;
    color: #6b7280;
    font-family: 'Courier New', monospace;
}

.account-contact-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-contact-sm {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-contact-sm:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-contact-sm-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.btn-contact-sm-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

@media (max-width: 640px) {
    .account-contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .account-contact-actions {
        width: 100%;
        justify-content: stretch;
    }

    .btn-contact-sm {
        flex: 1;
        text-align: center;
    }
}
