*{
margin:0;
padding:0;
box-sizing:border-box;
}

:root{
--primary:#2563eb;
--primary-dark:#1d4ed8;
--primary-soft:#eff6ff;
--dark:#0f172a;
--text:#334155;
--muted:#64748b;
--line:#e2e8f0;
--bg:#f6f8fb;
--white:#ffffff;
--danger:#dc2626;
--shadow:0 20px 45px rgba(15,23,42,.08);
}

html{
scroll-behavior:smooth;
}

body{
font-family:'Inter',sans-serif;
background:var(--bg);
color:var(--dark);
line-height:1.7;
min-height:100vh;
overflow-x:hidden;
}

img{
max-width:100%;
display:block;
}

.topbar{
width:100%;
height:76px;
display:flex;
align-items:center;
justify-content:space-between;
gap:14px;
padding:0 7%;
background:rgba(255,255,255,.96);
border-bottom:1px solid var(--line);
position:sticky;
top:0;
z-index:1000;
backdrop-filter:blur(14px);
}

.logo{
font-size:1.35rem;
font-weight:900;
letter-spacing:-.03em;
color:var(--primary);
}

.back-btn,
.edit-btn{
text-decoration:none;
display:inline-flex;
align-items:center;
justify-content:center;
padding:10px 16px;
border-radius:14px;
font-weight:800;
font-size:.92rem;
transition:.25s;
}

.back-btn{
background:var(--primary-soft);
color:var(--primary);
border:1px solid #dbeafe;
}

.edit-btn{
background:linear-gradient(135deg,var(--primary),var(--primary-dark));
color:white;
box-shadow:0 12px 24px rgba(37,99,235,.22);
}

.back-btn:hover,
.edit-btn:hover{
transform:translateY(-2px);
}

.profile-page{
min-height:100vh;
}

.profile-hero{
padding:54px 7%;
position:relative;
overflow:hidden;
background:
linear-gradient(rgba(15,23,42,.68),rgba(15,23,42,.68)),
url('https://images.unsplash.com/photo-1517849845537-4d257902454a?q=80&w=1400&auto=format&fit=crop');
background-size:cover;
background-position:center;
}

.hero-content{
max-width:1040px;
margin:auto;
display:grid;
grid-template-columns:auto minmax(0,1fr);
gap:24px;
align-items:center;
}

.avatar-wrap{
position:relative;
width:116px;
height:116px;
}

.avatar{
width:116px;
height:116px;
border-radius:50%;
background:linear-gradient(135deg,var(--primary),#60a5fa);
border:5px solid rgba(255,255,255,.22);
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
box-shadow:0 18px 36px rgba(0,0,0,.25);
cursor:pointer;
}

.avatar img{
width:100%;
height:100%;
object-fit:cover;
display:none;
}

#avatarInitial{
font-size:2.15rem;
font-weight:900;
color:white;
}

.status-dot{
position:absolute;
right:4px;
bottom:7px;
width:22px;
height:22px;
border-radius:50%;
background:#22c55e;
border:4px solid white;
}

.identity{
color:white;
}

.account-label{
display:inline-flex;
align-items:center;
justify-content:center;
padding:7px 13px;
border-radius:999px;
background:var(--primary-soft);
border:1px solid #dbeafe;
color:var(--primary);
font-size:.72rem;
font-weight:900;
text-transform:uppercase;
letter-spacing:.08em;
margin-bottom:12px;
box-shadow:0 10px 22px rgba(37,99,235,.12);
}

.identity h1{
font-size:clamp(1.55rem,3.2vw,2.45rem);
line-height:1.12;
font-weight:900;
letter-spacing:-.04em;
max-width:640px;
}

.identity p{
margin-top:9px;
color:rgba(255,255,255,.84);
font-size:.96rem;
}

.profile-container{
width:100%;
max-width:1120px;
margin:auto;
padding:42px 20px 68px;
}

.profile-grid{
display:grid;
grid-template-columns:1fr 1fr;
gap:22px;
}

.panel{
background:white;
border:1px solid var(--line);
border-radius:26px;
padding:28px;
box-shadow:var(--shadow);
}

.panel-head{
margin-bottom:22px;
}

.panel-head span{
display:inline-flex;
padding:7px 12px;
border-radius:999px;
background:var(--primary-soft);
color:var(--primary);
font-size:.72rem;
font-weight:900;
text-transform:uppercase;
letter-spacing:.08em;
margin-bottom:11px;
}

.panel-head h2{
font-size:1.38rem;
line-height:1.18;
font-weight:900;
letter-spacing:-.035em;
color:#0f172a;
}

.panel-head p{
margin-top:8px;
color:#64748b;
font-size:.96rem;
}

.info-list{
display:flex;
flex-direction:column;
gap:10px;
}

.info-row{
display:flex;
align-items:center;
justify-content:space-between;
gap:18px;
padding:14px 0;
border-bottom:1px solid #e5e7eb;
}

.info-row:last-child{
border-bottom:none;
}

.info-row span{
font-size:.90rem;
font-weight:700;
color:#64748b;
}

.info-row strong{
font-size:.95rem;
font-weight:900;
color:#0f172a;
text-align:right;
}

.premium-panel{
background:white;
border-color:#dbeafe;
}

.premium-status{
padding:20px;
border-radius:20px;
background:#f8fafc;
border:1px solid #e2e8f0;
margin-bottom:16px;
}

.premium-status strong{
display:block;
font-size:1.55rem;
line-height:1.12;
font-weight:900;
letter-spacing:-.04em;
color:#0f172a;
margin-bottom:8px;
}

.premium-status p{
color:#64748b;
font-size:.94rem;
font-weight:600;
}

.premium-dates{
display:grid;
grid-template-columns:1fr 1fr;
gap:12px;
}

.premium-dates div{
background:#f8fafc;
border:1px solid #e2e8f0;
border-radius:18px;
padding:16px;
}

.premium-dates span{
display:block;
font-size:.72rem;
font-weight:900;
color:#64748b;
text-transform:uppercase;
letter-spacing:.06em;
margin-bottom:7px;
}

.premium-dates strong{
display:block;
font-size:.95rem;
font-weight:900;
color:#0f172a;
}

.premium-action{
display:none !important;
}

.activity-panel{
margin-top:22px;
}

.courses-list{
list-style:none;
display:flex;
flex-direction:column;
gap:11px;
}

.courses-list li{
display:flex;
align-items:center;
justify-content:space-between;
gap:14px;
padding:14px 17px;
border-radius:16px;
background:#f8fafc;
border:1px solid #e2e8f0;
font-weight:800;
font-size:.95rem;
color:#334155;
}

.courses-list li::after{
content:"Visitado";
font-size:.72rem;
font-weight:900;
color:var(--primary);
background:var(--primary-soft);
border-radius:999px;
padding:5px 10px;
}

.courses-list li.empty::after{
content:"";
display:none;
}

.logout-wrapper{
display:flex;
justify-content:center;
margin-top:32px;
}

.logout-btn{
border:none;
background:linear-gradient(135deg,#ef4444,#dc2626);
color:white;
padding:13px 32px;
border-radius:15px;
font-family:inherit;
font-size:.98rem;
font-weight:900;
cursor:pointer;
box-shadow:0 15px 30px rgba(220,38,38,.22);
transition:.25s;
}

.logout-btn:hover{
transform:translateY(-2px);
}

.avatar-popup{
border-radius:22px !important;
overflow:hidden !important;
padding:0 !important;
}

.avatar-image{
width:100% !important;
height:auto !important;
display:block !important;
margin:0 !important;
border-radius:0 !important;
object-fit:cover !important;
}

.avatar-close{
color:white !important;
font-size:20px !important;
background:rgba(0,0,0,.68) !important;
border-radius:50% !important;
width:34px !important;
height:34px !important;
top:8px !important;
right:8px !important;
}

@media(max-width:860px){
.profile-hero{
padding:50px 5%;
}

.hero-content{
grid-template-columns:1fr;
text-align:center;
justify-items:center;
gap:17px;
}

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

.identity h1{
max-width:520px;
}
}

@media(max-width:560px){
.topbar{
height:68px;
padding:0 5%;
}

.logo{
font-size:1.18rem;
}

.back-btn,
.edit-btn{
padding:8px 12px;
font-size:.82rem;
border-radius:11px;
}

.profile-hero{
padding:38px 5% 42px;
}

.avatar-wrap,
.avatar{
width:104px;
height:104px;
}

.avatar{
border-width:4px;
}

.status-dot{
width:20px;
height:20px;
right:2px;
bottom:6px;
border-width:4px;
}

.account-label{
font-size:.66rem;
padding:6px 11px;
margin-bottom:10px;
}

.identity h1{
font-size:1.55rem;
line-height:1.16;
letter-spacing:-.035em;
}

.identity p{
font-size:.90rem;
}

.profile-container{
padding:26px 14px 56px;
}

.panel{
padding:22px;
border-radius:22px;
}

.panel-head h2{
font-size:1.25rem;
}

.profile-grid{
gap:16px;
}

.info-row{
align-items:flex-start;
flex-direction:column;
gap:5px;
padding:12px 0;
}

.info-row strong{
text-align:left;
}

.premium-status strong{
font-size:1.35rem;
}

.premium-dates{
grid-template-columns:1fr;
}

.premium-dates div{
padding:14px;
}

.courses-list li{
align-items:flex-start;
flex-direction:column;
font-size:.92rem;
}

.logout-btn{
width:100%;
max-width:230px;
}
}

/* Ajuste v42: botón Mi correo con estilo de etiqueta Cuenta */
.account-email-btn{
border:none;
cursor:pointer;
font-family:'Inter',sans-serif;
transition:.25s;
}

.account-email-btn:hover{
transform:translateY(-2px);
background:#dbeafe;
box-shadow:0 14px 26px rgba(37,99,235,.18);
}

.email-popup-text{
font-size:1rem;
font-weight:800;
color:#0f172a;
overflow-wrap:anywhere;
line-height:1.6;
}
