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

body {
    font-family: 'DM Sans', Arial, sans-serif;
    background: #1a1a1a;
    color: #d0d0d0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Rahmen strukturell ── */
.page-wrap { margin-top: 60px; flex: 1; display: flex; flex-direction: column; }
.frame-row { flex: 1; display: flex; flex-direction: row; }

.frame-side {
    width: 20px; flex-shrink: 0;
    background: #111; transition: background 0.4s;
}
body.logged-in .frame-side { background: rgba(192,200,208,0.12); }

.frame-bottom { height: 20px; background: #111; transition: background 0.4s; }
body.logged-in .frame-bottom { background: rgba(192,200,208,0.12); }

.content-area {
    flex: 1; background: #1a1a1a;
    display: flex; flex-direction: column;
    gap: 6px; padding: 6px 0;
}

/* ── Cards (Spiegel/Glas) ── */
.card-title {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 40px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 32px rgba(0,0,0,0.4);
}

.card-title::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.01) 50%, rgba(255,255,255,0.04) 100%);
    pointer-events: none;
}

.card-text {
  
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 36px 48px 44px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 32px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
     
}

.card-text::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 60%);
    pointer-events: none;
}

/* Card 1 links */
.card-title-left { display: flex; flex-direction: column; gap: 12px; }

.paw-icon {
    width: 56px; height: 56px;
    opacity: 0; animation: up 0.6s ease 0.1s forwards;
}

.hero-eyebrow {
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: #c0c8d0;
    opacity: 0; animation: up 0.6s ease 0.25s forwards;
}

.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(64px, 11vw, 130px);
    line-height: 0.9;
    background: linear-gradient(135deg, #ff9f43 0%, #ff7a18 50%, #ffd6a5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0; animation: up 0.6s ease 0.4s forwards;
    position: relative;
}



/* Card 1 rechts: Logo */
.card-title-right {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: flex-end;
    opacity: 0; animation: up 0.6s ease 0.5s forwards;
}
.card-title-right img {
    height: clamp(200px, 17vw, 210px);
    width: auto; object-fit: contain;
    border-radius: 14px;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.6));
}

.card-title::after {
    content: "";
    position: absolute;
    right: -80px; top: -60px;
    width: 380px; height: 380px;
    /*background: url('../img/pawgress_logo.png') no-repeat center/contain;*/
    opacity: 1;
    pointer-events: none;
}

/* Card 2 */
.hero-sub {
    font-size: clamp(15px, 1.6vw, 18px); line-height: 1.85;
    color: #888; font-weight: 300; max-width: 600px; margin-bottom: 36px;
    opacity: 0; animation: up 0.6s ease 0.6s forwards;
}
.hero-sub strong { color: #c0c8d0; font-weight: 500; }

.hero-cta { opacity: 0; animation: up 0.6s ease 0.75s forwards; }

.btn-primary {
    display: inline-flex; align-items: center;
    padding: 14px 36px;
    background: rgba(192,200,208,0.15);
    color: #e8eaec;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px; font-weight: 600; letter-spacing: 0.04em;
    border: 1px solid rgba(192,200,208,0.35);
    border-radius: 50px; cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 4px 16px rgba(0,0,0,0.3);
}
.btn-primary:hover {
    background: rgba(192,200,208,0.25);
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 8px 24px rgba(0,0,0,0.4);
}

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

@media (max-width: 700px) {
    .frame-side { width: 10px; }
    .frame-bottom { height: 10px; }
    .card-title { padding: 28px 22px; flex-direction: column; align-items: flex-start; }
    .card-text  { padding: 24px 22px 32px; }
    .card-title-right { width: 100%; justify-content: center; }
    .card-title-right img { height: 120px; }
}

/* ── Auth Card ── */
.card-auth {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 32px 48px 40px;
    display: none;
    animation: up 0.4s ease forwards;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 32px rgba(0,0,0,0.4);
    position: relative; overflow: hidden;
}
.card-auth::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 60%);
    pointer-events: none;
}
.card-auth.visible { display: block; }

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
    margin-bottom: 28px;
    border: 1px solid rgba(255,255,255,0.08);
}
.auth-tab {
    padding: 9px 24px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #666;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.auth-tab.active {
    background: rgba(192,200,208,0.18);
    color: #e0e4e8;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
.auth-tab:not(.active):hover { color: #aaa; }

/* Formulare */
.auth-form { display: block; }
.auth-form.hidden { display: none; }

.fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
    margin-bottom: 28px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}
.fields-grid .field-group { margin-bottom: 0; }

.field-group label {
    font-size: 12px;
    font-weight: 500;
    color: #555;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.field-group input {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 11px 16px;
    color: #d0d0d0;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(8px);
}
.field-group input:focus {
    border-color: rgba(192,200,208,0.5);
    box-shadow: 0 0 0 3px rgba(192,200,208,0.08);
}
.field-group input::placeholder { color: #3a3a3a; }

/* Aktionszeile */
.auth-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.btn-ghost {
    padding: 13px 24px;
    background: transparent;
    color: #555;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 50px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.22); color: #aaa; }

.auth-success {
    margin-top: 14px;
    font-size: 13px;
    color: #ff9f43;
    display: none;
    line-height: 1.5;
}

.auth-success.visible {
    
    display: block;
    animation: up 0.3s ease forwards;
}

/* Fehlermeldung */
.auth-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-bottom: 16px;
    min-height: 0;
    display: none;
}
.auth-error.visible {
    display: block;
    animation: up 0.3s ease forwards;
    opacity : 1;
}

@media (max-width: 700px) {
    .card-auth { padding: 24px 22px 32px; }
    .fields-grid { grid-template-columns: 1fr; }
}

body.logged-in #hero-cta { display: none; }

/* ── Goals Card ── */
.card-goals {
    display: none;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 32px 48px;
    animation: up 0.5s ease forwards;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 32px rgba(0,0,0,0.4);
    position: relative; overflow: hidden;
}
.card-goals::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 60%);
    pointer-events: none;
}
body.logged-in .card-goals { display: block; }

.goals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.goal-tile {
    background: rgba(0,0,0,0.2);
    border-radius: 14px;
    padding: 32px 20px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(255,255,255,0.07);
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.goal-tile::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(160deg, rgba(255,255,255,0.05) 0%, transparent 60%);
    pointer-events: none;
}
.goal-tile:hover {
    border-color: rgba(192,200,208,0.35);
    background: rgba(255,255,255,0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 4px 20px rgba(0,0,0,0.3);
}

.goal-icon {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
      color: var(--text-muted);
    transition: transform 0.25s;
}
.goal-icon svg { width: 100%; height: 100%; }
.goal-tile:hover .goal-icon { transform: scale(1.12); color: var(--color-accent); }

.goal-label {
    font-size: 13px; font-weight: 500;
      color: var(--text-muted);
    letter-spacing: 0.04em; text-align: center;
    opacity: 0; transform: translateY(4px);
    transition: opacity 0.25s, transform 0.25s;
    min-height: 18px;
}
.goal-tile:hover .goal-label { opacity: 1; transform: translateY(0);color: var(--color-accent) }

.goal-count {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 48px; line-height: 1;
    color: #2e2e2e;
    transition: color 0.25s;
    margin-top: 8px;
}
.goal-tile:hover .goal-count {     border-color: var(--color-accent); }

@media (max-width: 700px) {
    .card-goals { padding: 24px 22px; }
    .goals-grid { grid-template-columns: 1fr; gap: 10px; }
    .goal-label { opacity: 1; transform: none; position: static; }
}




.card-friends  {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 36px 48px 44px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 32px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
     
}

.card-friends::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 60%);
    pointer-events: none;
     
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    gap: 10px;
}

.friend-item span {
    font-weight: 500;
}

.friend-item button {
    background: linear-gradient(135deg, #ff8a00, #ffb347);
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}

.friends-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.friend-tile {
    padding: 15px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

.friend-tile h3 {
    margin-bottom: 10px;
    font-size: 16px;
    opacity: 0.8;
      margin-bottom: 20px;
}





/*  CHATS*/


.card-text-chat {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(20px);
    border-radius: 16px;

    padding: 36px 48px 44px;

    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12),
                0 8px 32px rgba(0,0,0,0.4);

    position: relative;
    overflow: visible; /* 🔥 wichtig */

    display: flex;
    flex-direction: column;
}






/* ───────── CHAT SYSTEM ───────── */

.chat-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 250px;
}

/* Card */
.chat-card {
    perspective: 1000px;
}

.chat-inner {
    position: relative;
    width: 100%;

    height: 60px; /*  Standard = klein */

    transition: transform 0.6s, height 0.3s ease;
    transform-style: preserve-3d;
    padding-bottom: 20px;
}

.chat-card.flipped .chat-inner {
    transform: rotateY(180deg);
     height: 350px; /*  geöffnet = groß */
}

/* FRONT */
.chat-front {
    height: 70px;
    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
     backface-visibility: hidden;
}

.chat-front h3 {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
}

/* BACK */
.chat-back {
    position: absolute;
inset: 0;
    backface-visibility: hidden;

    border-radius: 12px;
    padding: 15px 15px 20px;

    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);

    transform: rotateY(180deg);

    display: flex;
    flex-direction: column;

    
    box-sizing: border-box;
    overflow: hidden;
}

/* BUTTON ICON */
.chat-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;

    background: linear-gradient(135deg, #ff8a00, #ffb347);
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
    cursor: pointer;

    transition: all 0.2s ease;
}

.chat-btn-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255,138,0,0.4);
}

/* MESSAGES */
.messages {
    flex: 1;
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 8px;

    min-height: 0; 
}

.message {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    word-break: break-word;
}

/* eigene Nachricht */
.message.me {
    align-self: flex-end;
    background: linear-gradient(135deg, #ff8a00, #ffb347);
    color: white;
}

/* fremde Nachricht */
.message.other {
    align-self: flex-start;
    background: rgba(255,255,255,0.1);
}

/* INPUT */
.chat-input {
    display: flex;
    gap: 8px;

   
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);

    /* wichtig */
    flex-shrink: 0;
}
.msg-text {
    margin-bottom: 4px;
}

.msg-time {
    font-size: 10px;
    opacity: 0.6;
    color: var(--bg-main);
    font-weight: bold;
    font-style: italic;
}

/* optional schöner */
.message.me .msg-time {
    text-align: right;
}

.message.other .msg-time {
    text-align: left;
}
.chat-input input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
    color: #d0d0d0;
    outline: none;
}

.chat-input input:focus {
    border-color: rgba(255,255,255,0.3);
}

.chat-header {
    font-size: 13px;
    opacity: 0.7;
    margin-bottom: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
    text-align: center;
    position: relative;
}

.chat-header:hover {
    opacity: 1;
}
.new-chat {
    opacity: 0.8;
}
.chat-header {
    text-align: center;
    margin-bottom: 10px;
}

.chat-title {
    font-size: 15px;
    font-weight: 500;
    opacity: 0.85;
}

.chat-front-left {
    display: flex;
    flex-direction: column;
}

.chat-time {
    font-size: 11px;
    opacity: 0.5;
}
/* SEND BUTTON */
.chat-input button {
    background: linear-gradient(135deg, #ff8a00, #ffb347);
    border: none;
    border-radius: 10px;
    padding: 0 14px;
    cursor: pointer;
    color: white;
}

/* SCROLLBAR */
.messages::-webkit-scrollbar {
    width: 6px;
}

.messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

#friend-search-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: none;
    background: rgba(0,0,0,0.3);
    color: white;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-badge {
    background: #ff3b30;
    color: white;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 12px;
}