:root{
    --bg: #f4f7f2;
    --bg-soft: #edf3eb;
    --card: rgba(255,255,255,.92);
    --text: #1f2a24;
    --muted: #66756c;
    --line: rgba(31,42,36,.08);
    --primary: #1f6f5f;
    --primary-dark: #155246;
    --accent: #8fbf5a;
    --danger: #c84b4b;
    --danger-dark: #a53636;
    --shadow: 0 10px 30px rgba(21, 39, 31, 0.08);
    --radius: 20px;
}

*{
    box-sizing:border-box;
}

html, body{
    margin:0;
    padding:0;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Arial,sans-serif;
    color:var(--text);
    background:
        radial-gradient(circle at top right, rgba(143,191,90,.18), transparent 24%),
        radial-gradient(circle at top left, rgba(31,111,95,.12), transparent 22%),
        linear-gradient(180deg, #f6faf4 0%, #eef5ed 100%);
    min-height:100%;
}

body{
    display:flex;
    flex-direction:column;
}

.container{
    width:100%;
    max-width:860px;
    margin:0 auto;
    padding:18px 14px 30px;
}

.hero{
    position:relative;
    overflow:hidden;
    border-radius:28px;
    padding:24px 22px;
    background:
        linear-gradient(135deg, rgba(31,111,95,.95), rgba(41,136,90,.92)),
        linear-gradient(180deg, #1f6f5f, #2f8c63);
    color:#fff;
    box-shadow:0 18px 40px rgba(22, 66, 50, .18);
    margin-bottom:18px;
}

.hero::after{
    content:"";
    position:absolute;
    right:-40px;
    top:-40px;
    width:180px;
    height:180px;
    background:rgba(255,255,255,.08);
    border-radius:50%;
}

.hero::before{
    content:"";
    position:absolute;
    right:70px;
    bottom:-55px;
    width:130px;
    height:130px;
    background:rgba(255,255,255,.06);
    border-radius:50%;
}

.hero-top{
    position:relative;
    z-index:1;
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:16px;
    flex-wrap:wrap;
}

.brand{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    width:max-content;
    padding:8px 12px;
    border-radius:999px;
    background:rgba(255,255,255,.14);
    backdrop-filter:blur(8px);
    font-size:13px;
    font-weight:600;
    letter-spacing:.2px;
}

.hero h1{
    margin:0;
    font-size:28px;
    line-height:1.15;
    font-weight:800;
    letter-spacing:-0.02em;
}

.hero p{
    margin:0;
    max-width:580px;
    color:rgba(255,255,255,.85);
    font-size:15px;
    line-height:1.5;
}

.hero-stats{
    position:relative;
    z-index:1;
    min-width:155px;
    padding:14px 16px;
    border-radius:18px;
    background:rgba(255,255,255,.14);
    backdrop-filter:blur(8px);
    text-align:left;
}

.hero-stats .num{
    display:block;
    font-size:28px;
    font-weight:800;
    line-height:1;
    margin-bottom:6px;
}

.hero-stats .label{
    color:rgba(255,255,255,.82);
    font-size:13px;
}

.flash{
    margin-bottom:16px;
    padding:14px 16px;
    border-radius:18px;
    background:#e8f5ed;
    border:1px solid rgba(31,111,95,.12);
    color:#1b5c4e;
    box-shadow:var(--shadow);
}

.card{
    background:var(--card);
    border:1px solid rgba(255,255,255,.55);
    box-shadow:var(--shadow);
    border-radius:var(--radius);
    padding:18px;
    margin-bottom:16px;
    backdrop-filter: blur(10px);
}

.section-title{
    margin:0 0 14px;
    font-size:20px;
    font-weight:800;
    letter-spacing:-0.02em;
}

.section-subtitle{
    margin:-6px 0 16px;
    color:var(--muted);
    font-size:14px;
}

form{
    margin:0;
}

.form-row{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

input{
    flex:1;
    min-width:180px;
    width:100%;
    padding:14px 16px;
    border-radius:14px;
    border:1px solid var(--line);
    background:#fff;
    color:var(--text);
    font-size:15px;
    outline:none;
    transition:.2s border-color, .2s box-shadow, .2s transform;
}

input:focus{
    border-color:rgba(31,111,95,.45);
    box-shadow:0 0 0 4px rgba(31,111,95,.08);
}

button,
.btn,
a.btn{
    appearance:none;
    border:none;
    text-decoration:none;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:46px;
    padding:0 16px;
    border-radius:14px;
    font-size:15px;
    font-weight:700;
    transition:.2s transform, .2s opacity, .2s background;
}

button:hover,
.btn:hover{
    transform:translateY(-1px);
}

.btn-primary,
button[name="add_reptile"],
button[name="add_feed"]{
    background:var(--primary);
    color:#fff;
}

.btn-primary:hover,
button[name="add_reptile"]:hover,
button[name="add_feed"]:hover{
    background:var(--primary-dark);
}

.btn-secondary{
    background:#eef4ef;
    color:var(--text);
    border:1px solid var(--line);
}

.btn-danger,
button[name="delete_reptile"]{
    background:var(--danger);
    color:#fff;
}

.btn-danger:hover,
button[name="delete_reptile"]:hover{
    background:var(--danger-dark);
}

.reptile-list{
    display:grid;
    gap:12px;
}

.reptile-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:16px;
    border-radius:18px;
    background:linear-gradient(180deg, #ffffff, #f7fbf6);
    border:1px solid rgba(31,42,36,.06);
    text-decoration:none;
    color:inherit;
    transition:.2s transform, .2s box-shadow, .2s border-color;
}

.reptile-item:hover{
    transform:translateY(-2px);
    box-shadow:0 12px 28px rgba(22, 53, 40, .08);
    border-color:rgba(31,111,95,.14);
}

.reptile-main{
    display:flex;
    flex-direction:column;
    gap:6px;
    min-width:0;
}

.reptile-name{
    font-size:17px;
    font-weight:800;
    line-height:1.2;
    word-break:break-word;
}

.reptile-meta{
    font-size:13px;
    color:var(--muted);
}

.reptile-days{
    white-space:nowrap;
    padding:10px 12px;
    border-radius:999px;
    background:#eef7f1;
    color:var(--primary);
    font-size:13px;
    font-weight:700;
}

.empty{
    padding:18px;
    border-radius:18px;
    background:var(--bg-soft);
    color:var(--muted);
    text-align:center;
    border:1px dashed rgba(31,42,36,.1);
}

.reptile-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:8px;
    flex-wrap:wrap;
}

.reptile-title{
    margin:0;
    font-size:28px;
    font-weight:800;
    letter-spacing:-0.02em;
    cursor:pointer;
}

.feed-list{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin:16px 0 18px;
}

.feed-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:14px 14px;
    border-radius:16px;
    background:#f7faf7;
    border:1px solid rgba(31,42,36,.06);
}

.feed-text{
    font-size:14px;
    line-height:1.45;
    word-break:break-word;
}

.feed-delete-form{
    flex-shrink:0;
}

.feed-delete{
    width:38px;
    min-height:38px;
    padding:0;
    border-radius:12px;
    background:#fff1f1;
    color:var(--danger);
    border:1px solid rgba(200,75,75,.12);
    font-size:16px;
    font-weight:800;
}

.feed-delete:hover{
    background:#ffe4e4;
}

.inline-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:14px;
}

.muted{
    color:var(--muted);
    font-size:14px;
}

.badge a {
    display: inline-block;          /* Чтобы можно было задавать отступы и размеры */
    padding: 6px 12px;             /* Внутренние отступы */
    background-color: #4CAF50;     /* Зеленый фон */
    color: #fff;                    /* Белый текст */
    text-decoration: none;          /* Убираем подчеркивание */
    border-radius: 12px;            /* Скругленные края */
    font-weight: bold;              /* Жирный текст */
    transition: all 0.3s ease;     /* Плавная анимация при наведении */
}

.badge a:hover {
    background-color: #45a049;      /* Темнее при наведении */
    color: #fff;
    transform: translateY(-2px);    /* Легкий подъем при наведении */
    box-shadow: 0 4px 6px rgba(0,0,0,0.2); /* Тень при наведении */
}

.toggle-btn{
    width:100%;
    justify-content:space-between;
    background:#f3f7f3;
    color:var(--text);
    border:1px solid rgba(31,42,36,.06);
}

.recovery-box{
    display:none;
    margin-top:14px;
    padding-top:14px;
    border-top:1px solid var(--line);
}

.code-box{
    display:inline-block;
    padding:8px 12px;
    border-radius:12px;
    background:#f3f7f3;
    font-weight:800;
    letter-spacing:.08em;
    margin-top:6px;
}

.footer{
    margin-top:auto;
    padding:18px 14px 30px;
}

.footer-inner{
    max-width:860px;
    margin:0 auto;
    padding:18px 20px;
    border-radius:22px;
    background:rgba(255,255,255,.72);
    border:1px solid rgba(255,255,255,.7);
    backdrop-filter:blur(10px);
    color:var(--muted);
    box-shadow:var(--shadow);
    display:flex;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
}

.footer strong{
    color:var(--text);
}

.back-link{
    display:inline-flex;
    align-items:center;
    gap:8px;
    color:var(--primary);
    font-weight:700;
    text-decoration:none;
    margin-top:10px;
}

.edit-box{
    display:none;
    margin:8px 0 10px;
}

@media (max-width: 640px){
    .container{
        padding:14px 12px 24px;
    }

    .hero{
        padding:20px 18px;
        border-radius:24px;
    }

    .hero h1{
        font-size:24px;
    }

    .reptile-title{
        font-size:24px;
    }

    .card{
        padding:16px;
    }

    .form-row{
        flex-direction:column;
    }

    button,
    .btn,
    a.btn{
        width:100%;
    }

    .footer-inner{
        flex-direction:column;
    }
}