* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; min-height: 100vh; background: linear-gradient(135deg, #0f0c29, #302b63, #24243e); color: #fff; }
.container { max-width: 440px; margin: 0 auto; padding: 40px 20px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.card { background: rgba(255,255,255,0.08); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.12); border-radius: 20px; padding: 40px 32px; }
.logo { text-align: center; margin-bottom: 32px; }
.logo h1 { font-size: 28px; font-weight: 700; background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo p { color: rgba(255,255,255,0.5); margin-top: 8px; font-size: 14px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 6px; font-weight: 500; }
.form-group input { width: 100%; padding: 14px 16px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 12px; color: #fff; font-size: 15px; transition: all 0.3s; outline: none; }
.form-group input:focus { border-color: #667eea; background: rgba(255,255,255,0.1); box-shadow: 0 0 0 3px rgba(102,126,234,0.2); }
.form-group input::placeholder { color: rgba(255,255,255,0.3); }
.btn { width: 100%; padding: 14px; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(102,126,234,0.4); }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #fff; margin-top: 12px; }
.btn-outline:hover { background: rgba(255,255,255,0.08); }
.links { text-align: center; margin-top: 20px; }
.links a { color: #667eea; text-decoration: none; font-size: 14px; }
.links a:hover { text-decoration: underline; }
.error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; }
.success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #86efac; padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; }
/* Landing */
.landing { text-align: center; }
.landing h1 { font-size: 48px; font-weight: 800; line-height: 1.1; margin-bottom: 16px; }
.landing h1 span { background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.landing p { color: rgba(255,255,255,0.6); font-size: 18px; margin-bottom: 40px; line-height: 1.6; }
.landing .buttons { display: flex; gap: 12px; justify-content: center; }
.landing .buttons .btn { width: auto; padding: 14px 32px; }
/* Home */
.home-card { text-align: center; }
.home-card .avatar { width: 80px; height: 80px; background: linear-gradient(135deg, #667eea, #764ba2); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 32px; }
.home-card h2 { font-size: 24px; margin-bottom: 8px; }
.home-card .email { color: rgba(255,255,255,0.5); font-size: 14px; margin-bottom: 32px; }
/* App pages (white bg) */
body.app-page { background: #fff; color: #1a1a1a; }
.app-container { max-width: 900px; margin: 0 auto; padding: 24px 20px; min-height: 100vh; display: block; }
.app-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 12px; }
.app-header-left { display: flex; flex-direction: column; }
.app-header-right { display: flex; gap: 8px; align-items: center; }
.app-title { font-size: 24px; font-weight: 700; color: #1a1a1a; }
.app-subtitle { color: #888; font-size: 14px; }
.back-link { color: #667eea; text-decoration: none; font-size: 14px; font-weight: 500; }
.back-link:hover { text-decoration: underline; }

.btn-add { display: inline-block; padding: 10px 20px; background: #1a1a1a; color: #fff; border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 600; transition: background 0.2s; }
.btn-add:hover { background: #333; }
.btn-logout { padding: 10px 20px; background: transparent; border: 1px solid #ddd; color: #888; border-radius: 10px; text-decoration: none; font-size: 14px; }
.btn-logout:hover { background: #f5f5f5; }
.btn-small { padding: 6px 14px; background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 13px; cursor: pointer; color: #444; }
.btn-small:hover { background: #eee; }
.btn-small.btn-danger { color: #e53e3e; }
.btn-small.btn-danger:hover { background: #fee; }

/* Projects grid */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.project-card { display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid #eee; border-radius: 14px; text-decoration: none; color: inherit; transition: box-shadow 0.2s, border-color 0.2s; }
.project-card:hover { border-color: #ccc; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.project-avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: #f5f5f5; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 24px; }
.project-avatar img { width: 100%; height: 100%; object-fit: cover; }
.project-info h3 { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.project-info p { font-size: 13px; color: #888; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: #888; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h2 { font-size: 20px; color: #1a1a1a; margin-bottom: 8px; }
.empty-state p { margin-bottom: 24px; }

/* Form card */
.form-card { max-width: 480px; background: #fff; border: 1px solid #eee; border-radius: 14px; padding: 32px; }
.form-group-app { margin-bottom: 20px; }
.form-group-app label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; font-weight: 500; }
.form-group-app input { width: 100%; padding: 12px 14px; border: 1px solid #ddd; border-radius: 10px; font-size: 15px; outline: none; transition: border-color 0.2s; color: #1a1a1a; background: #fff; }
.form-group-app input:focus { border-color: #667eea; }
.btn-submit { width: 100%; padding: 14px; background: #1a1a1a; color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-submit:hover { background: #333; }

/* Profile header */
.profile-header { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; padding: 24px; border: 1px solid #eee; border-radius: 14px; }
.profile-pic { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #f5f5f5; }
.profile-pic img { width: 100%; height: 100%; object-fit: cover; }
.profile-pic-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 32px; }
.profile-info { flex: 1; min-width: 200px; }
.profile-info h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.ig-link { color: #667eea; text-decoration: none; font-size: 14px; }
.ig-link:hover { text-decoration: underline; }
.bio { margin-top: 8px; font-size: 14px; color: #555; line-height: 1.5; }
.rename-form { display: flex; gap: 8px; align-items: center; }
.rename-input { padding: 6px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; width: 160px; }

/* Posts grid */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.post-item { aspect-ratio: 1; overflow: hidden; background: #f5f5f5; border-radius: 4px; }
.post-item img { width: 100%; height: 100%; object-fit: cover; }

/* Error on app pages */
body.app-page .error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; }

@media (max-width: 480px) {
    .card { padding: 28px 20px; }
    .landing h1 { font-size: 36px; }
    .landing .buttons { flex-direction: column; }
    .landing .buttons .btn { width: 100%; }
    .posts-grid { gap: 2px; }
    .profile-header { padding: 16px; }
    .rename-form { width: 100%; }
    .rename-input { flex: 1; }
}
