/* ================= BASE ================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(to bottom, #f3e8d7, #e6d6be);
    color: #4a3f2b;
    -webkit-font-smoothing: antialiased;

}

/* ================= CAMERA DESIGN ================= */

.camera-container {
    margin: 25px;
    padding: 25px;
    background: rgba(255,255,255,0.95);
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
    text-align: center;
}

.camera-header {
    margin-bottom: 15px;
}

.camera-status {
    font-weight: 600;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 20px;
}

.camera-status.off {
    background: #eee;
    color: #777;
}

.camera-status.on {
    background: #ff4d4d;
    color: white;
}

.camera-video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(70vh, 520px);
    background: #000;
    border-radius: 25px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.camera-video-wrapper img,
.camera-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.camera-btn {
    padding: 12px 22px;
    border-radius: 25px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

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

.start-btn {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
}

.stop-btn {
    background: linear-gradient(135deg, #f44336, #b71c1c);
    color: white;
}

.camera-status.on {
    background: #ff4d4d;
    color: white;
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* FORCE CAMERA STYLE */

#camera-screen .camera-container {
    margin: 25px !important;
    padding: 25px !important;
    background: white !important;
    border-radius: 30px !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1) !important;
    text-align: center !important;
}

#camera-screen .camera-btn {
    padding: 12px 22px !important;
    border-radius: 25px !important;
    border: none !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

#camera-screen .start-btn {
    background: linear-gradient(135deg, #4caf50, #2e7d32) !important;
    color: white !important;
}

#camera-screen .stop-btn {
    background: linear-gradient(135deg, #f44336, #b71c1c) !important;
    color: white !important;
}

#camera-screen .camera-video-wrapper {
    width: 100% !important;
    aspect-ratio: 16/9 !important;
    max-height: min(70vh, 520px) !important;
    background: black !important;
    border-radius: 25px !important;
    overflow: hidden !important;
    margin-bottom: 20px !important;
}

#camera-screen .camera-video-wrapper img,
#camera-screen .camera-video-wrapper video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.camera-video-wrapper {
    position: relative;
}

.fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    z-index: 10;
}

.fullscreen-btn:hover {
    background: rgba(0,0,0,0.8);
}


.app {
    padding: 20px;
    padding-bottom: 100px;
}

.reboot-btn {
    display: flex;
    align-items: center;
    gap: 10px;

    background: linear-gradient(135deg, #ff4d4d, #c0392b);
    color: white;

    padding: 12px 22px;
    border-radius: 14px;
    border: none;

    font-weight: 600;
    font-size: 14px;

    cursor: pointer;
    transition: all 0.3s ease;

    box-shadow: 
        0 4px 12px rgba(0,0,0,0.15),
        inset 0 -2px 4px rgba(0,0,0,0.2);
}

.reboot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 18px rgba(192,57,43,0.35),
        inset 0 -2px 4px rgba(0,0,0,0.2);
}

.reboot-btn:active {
    transform: scale(0.97);
}

.reboot-btn .icon {
    font-size: 16px;
    transition: transform 0.5s ease;
}

.reboot-btn:hover .icon {
    transform: rotate(180deg);
}
.reboot-container {
    display: flex;
    justify-content: center;   /* centre horizontal */
    align-items: center;       /* centre vertical si besoin */
    width: 100%;
    margin-top: 30px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  padding: 25px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  animation: fadeIn 0.25s ease;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 10px;
}

.modal-cancel {
  flex: 1;
  background: #ddd;
  border: none;
  padding: 10px;
  border-radius: 10px;
}

.modal-confirm {
  flex: 1;
  background: #c0392b;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 10px;
}

@keyframes fadeIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);

  display: none;

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

  z-index: 99999; /* 🔥 TRÈS IMPORTANT */
}

.device-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.device-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.device-card.selected {
    border-color: #b8874c;
    box-shadow: 0 10px 24px rgba(184,135,76,0.18);
}

.device-card.menu-active {
    z-index: 40;
}

.device-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.device-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.device-identity {
    min-width: 0;
}

.device-name {
    font-weight: 600;
    font-size: 16px;
}

.device-kind-badge {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f6efe4;
    color: #7c5a31;
    font-size: 12px;
    font-weight: 700;
}

.device-status {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.device-card.online .status-dot {
    background: #00c853;
    box-shadow: 0 0 8px #00c853;
}

.device-card.offline .status-dot {
    background: #ff5252;
}

.device-menu {
    position: relative;
    flex-shrink: 0;
}

.device-menu-toggle {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 12px;
    background: #f5eee3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    padding: 0;
}

.device-menu-toggle span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #4a3f2b;
    display: block;
}

.device-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: #fff;
    border: 1px solid rgba(184,135,76,0.2);
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(0,0,0,0.14);
    padding: 8px;
    display: none;
    z-index: 50;
}

.device-menu.open .device-menu-panel {
    display: block;
}

.device-menu-action {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: #4a3f2b;
    cursor: pointer;
}

.device-menu-action:hover {
    background: #f7f0e5;
}

.device-menu-action.danger {
    color: #b23b2a;
}

.catalog-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: rgba(41, 29, 16, 0.45);
    backdrop-filter: blur(8px);
    z-index: 100002;
}

.catalog-modal.show {
    display: flex;
}

.catalog-panel {
    width: min(940px, 96vw);
    max-height: 88vh;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(180deg, #fffaf2, #f6ecdd);
    border: 1px solid rgba(184, 135, 76, 0.2);
    box-shadow: 0 26px 60px rgba(77, 54, 26, 0.24);
    display: flex;
    flex-direction: column;
}

.catalog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(184, 135, 76, 0.18);
}

.catalog-head h3 {
    margin: 0;
    font-size: 20px;
    color: #4a3f2b;
}

.catalog-close {
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #f2e5d4;
    color: #5c4b35;
    font-size: 18px;
    cursor: pointer;
}

.catalog-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(184, 135, 76, 0.14);
    flex-wrap: wrap;
}

.catalog-filters select {
    min-width: 170px;
}

.catalog-filters .btn-primary {
    width: auto;
    padding: 10px 16px;
    border-radius: 12px;
}

.catalog-body {
    padding: 14px 16px 16px;
    overflow: auto;
    display: grid;
    gap: 12px;
}

.catalog-empty {
    color: #6b5a45;
    margin: 0;
}

.catalog-item-card {
    border: 1px solid rgba(184, 135, 76, 0.2);
    border-radius: 16px;
    background: #fffdf9;
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    padding: 12px;
    position: relative;
}

.catalog-item-card.launchable {
    cursor: pointer;
}

.catalog-item-card.launchable:hover {
    border-color: rgba(184, 135, 76, 0.45);
}

.catalog-item-media {
    position: relative;
}

.catalog-item-cover {
    width: 92px;
    height: 92px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(184, 135, 76, 0.18);
    display: block;
}

.catalog-item-cover.fallback {
    background: #f5ebdb;
    color: #7d6649;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
}

.catalog-lock {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
}

.catalog-item-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.catalog-item-head strong {
    font-size: 16px;
    color: #443723;
}

.catalog-chip {
    font-size: 11px;
    font-weight: 700;
    color: #8a6030;
    background: #f3e5cf;
    border: 1px solid rgba(184, 135, 76, 0.24);
    border-radius: 999px;
    padding: 3px 8px;
    white-space: nowrap;
}

.catalog-item-meta {
    margin-top: 6px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #6b5a45;
}

.catalog-item-desc {
    margin: 7px 0 0;
    color: #5f4f3b;
    font-size: 13px;
    line-height: 1.4;
}

.catalog-item-actions {
    margin-top: 9px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.catalog-action-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    background: linear-gradient(to right, #b88a57, #9c7445);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.catalog-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.catalog-radio-wrap {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    font-size: 13px;
    color: #4f3f2d;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid rgba(184, 135, 76, 0.22);
    background: #fbf1e2;
}

.catalog-radio-wrap.disabled {
    opacity: 0.55;
}

.catalog-iframe-overlay {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    background: #141111;
    z-index: 100003;
}

.catalog-iframe-overlay.show {
    display: flex;
}

.catalog-iframe-bar {
    height: 54px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #f7f2eb;
    background: rgba(20, 15, 10, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

#catalogIframeTitle {
    font-weight: 700;
}

#contentCatalogIframe {
    width: 100%;
    height: calc(100vh - 54px);
    border: none;
    background: #fff;
}

@media (max-width: 640px) {
    .catalog-item-card {
        grid-template-columns: 1fr;
    }

    .catalog-item-cover {
        width: 100%;
        height: 180px;
    }
}



.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 14px;
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.ui-dialog-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(37, 28, 17, 0.42);
  backdrop-filter: blur(10px);
  z-index: 100001;
}

.ui-dialog-backdrop.show {
  display: flex;
}

.ui-dialog-card {
  width: min(92vw, 430px);
  border-radius: 28px;
  padding: 24px 22px 20px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.72), rgba(255,255,255,0.96) 45%),
    linear-gradient(180deg, #fffaf2, #f8eee0);
  border: 1px solid rgba(184, 135, 76, 0.18);
  box-shadow:
    0 26px 60px rgba(77, 54, 26, 0.22),
    inset 0 1px 0 rgba(255,255,255,0.65);
  text-align: center;
}

.ui-dialog-badge {
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: linear-gradient(180deg, #f3d9b1, #e6bf86);
  box-shadow: 0 12px 24px rgba(184,138,87,0.24);
}

.ui-dialog-badge.danger {
  background: linear-gradient(180deg, #ffd6d1, #f2a39a);
  box-shadow: 0 12px 24px rgba(192,57,43,0.2);
}

.ui-dialog-badge.success {
  background: linear-gradient(180deg, #d7f7df, #97e2ac);
  box-shadow: 0 12px 24px rgba(46,204,113,0.18);
}

.ui-dialog-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #4a3f2b;
}

.ui-dialog-message {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: #6b5a45;
}

.ui-dialog-value-wrap {
  margin-top: 16px;
}

.ui-dialog-value {
  width: 100%;
  min-height: 84px;
  resize: none;
  border: none;
  outline: none;
  border-radius: 18px;
  padding: 14px;
  background: #f8efe1;
  color: #5a4831;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.06);
}

.ui-dialog-copy {
  margin-top: 10px;
  border: none;
  border-radius: 16px;
  padding: 10px 16px;
  background: linear-gradient(to right, #4fa3a5, #3c8c8f);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.ui-dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.ui-dialog-btn {
  flex: 1;
  border: none;
  border-radius: 18px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.ui-dialog-btn.secondary {
  background: #efe4d4;
  color: #6b5a45;
}

.ui-dialog-btn.primary {
  background: linear-gradient(to right, #b88a57, #9c7445);
  color: #fff;
  box-shadow: 0 10px 22px rgba(156,116,69,0.28);
}

.ui-dialog-btn.primary.danger {
  background: linear-gradient(to right, #d35b47, #b53a29);
  box-shadow: 0 10px 22px rgba(181,58,41,0.24);
}

.ui-toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  transform: translate(-50%, 30px);
  width: min(90vw, 420px);
  border-radius: 20px;
  padding: 14px 18px;
  background: rgba(45, 36, 25, 0.94);
  color: #fffaf3;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0,0,0,0.22);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
  z-index: 100002;
}

.ui-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.ui-toast.success {
  background: rgba(40, 95, 55, 0.96);
}

.ui-toast.error {
  background: rgba(122, 42, 33, 0.96);
}


/* ================= SCREENS ================= */

.screen {
    display: none;
    animation: fade 0.35s ease;
}

.screen.active {
    display: block;
}

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

/* ================= BANNIÈRE BOIS ================= */

.wood-banner {
    background: linear-gradient(#b88a57, #9c7445);
    color: white;
    padding: 12px;
    border-radius: 30px;
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    width: 70%;
    margin: 25px auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* ================= TEDDY ================= */

.teddy-wrapper {
    position: relative;
    width: 240px;
    margin: 30px auto;
}

.halo {
    position: absolute;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, #cbb38d 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.teddy-img {
    position: relative;
    width: 210px;
    display: block;
    margin: 15px auto;
    z-index: 1;
    filter: drop-shadow(0 20px 35px rgba(0,0,0,0.25));
}

/* ================= TEXT ================= */

.subtitle {
    text-align: center;
    font-size: 15px;
    color: #7a6b58;
    margin-bottom: 25px;
}

/* ================= CARDS ================= */

.card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 25px;
    margin: 25px 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}

.security-action-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.security-action-copy h3 {
    margin: 0 0 6px;
    font-size: 17px;
    color: #5f4a36;
}

.security-action-copy p {
    margin: 0;
    color: #7a6b58;
    font-size: 14px;
    line-height: 1.4;
}

.security-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.security-switch:disabled {
    cursor: wait;
    opacity: 0.65;
}

.security-switch-track {
    position: relative;
    width: 68px;
    height: 38px;
    border-radius: 999px;
    background: #d8c9b5;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.12);
    transition: background 0.22s ease;
}

.security-switch-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 5px 14px rgba(0,0,0,0.18);
    transition: transform 0.22s ease;
}

.security-switch-text {
    min-width: 32px;
    font-size: 13px;
    font-weight: 800;
    color: #8f7557;
    text-align: right;
    letter-spacing: 0.04em;
}

.security-switch.is-on .security-switch-track {
    background: linear-gradient(135deg, #6ec57a, #3f9f58);
}

.security-switch.is-on .security-switch-thumb {
    transform: translateX(30px);
}

.security-switch.is-on .security-switch-text {
    color: #3f9f58;
}

.security-switch:not(.is-on) .security-switch-text {
    color: #8f7557;
}

/* ================= BUTTONS ================= */

.btn-primary,
.btn-secondary {
    width: 90%;
    margin: 20px auto;
    display: block;
    padding: 15px;
    border-radius: 30px;
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-primary {
    background: linear-gradient(to right, #b88a57, #9c7445);
    color: white;
    box-shadow: 0 10px 25px rgba(156,116,69,0.4);
}

.btn-secondary {
    background: linear-gradient(to right, #4fa3a5, #3c8c8f);
    color: white;
    box-shadow: 0 8px 20px rgba(60,140,143,0.4);
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.97);
}

/* ================= PROFILE ================= */

.profile-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #6b5a45;
    margin-bottom: 6px;
}

.input-field {
    width: 100%;
    padding: 16px 18px;
    border-radius: 20px;
    border: 2px solid transparent;
    background: #f6efe4;
    font-size: 16px;
    transition: all 0.25s ease;
    outline: none;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
}

.input-field:focus {
    border-color: #b88a57;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(184,138,87,0.15);
}

.full-width {
    width: 100%;
}

/* ================= MODE SELECTOR ================= */

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border-radius: 25px;
    border: none;
    background: #e8d8c0;
    font-weight: bold;
    color: #6b5b45;
    cursor: pointer;
    transition: 0.2s ease;
}

.mode-btn:active {
    transform: scale(0.95);
}

.mode-btn.active {
    background: linear-gradient(to bottom, #5ba7b5, #3f8a98);
    color: white;
    box-shadow: 0 5px 15px rgba(63,138,152,0.4);
}

/* ================= AGE SLIDER ================= */

.age-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 10px;
    border-radius: 10px;
    background: linear-gradient(to right, #b88a57, #e0c4a0);
    outline: none;
}

.age-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    border: 4px solid #b88a57;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.age-slider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    border: 4px solid #b88a57;
    cursor: pointer;
}

/* ================= VOICE MODE ================= */

.teddy-voice-card {
    margin-top: 25px;
    text-align: center;
}

.voice-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #4a3f2b;
}

.voice-selector {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.voice-btn {
    position: relative;
    width: 100%;
    padding: 18px;
    border-radius: 20px;
    border: none;
    font-weight: bold;
    font-size: 16px;
    color: white;
    cursor: pointer;
    transition: 0.2s ease;
}

.voice-btn:active {
    transform: scale(0.98);
}

/* Effet sélection */

.voice-btn.active {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.6) inset;
}

.voice-btn.active::after {
    content: "✓";
    position: absolute;
    right: 20px;
    font-weight: bold;
    font-size: 18px;
}

/* Couleurs */

.voice-btn.blue {
    background: linear-gradient(to right, #3e7f92, #2f6a7c);
}

.voice-btn.gold {
    background: linear-gradient(to right, #d6a34d, #b7832f);
}

.voice-btn.green {
    background: linear-gradient(to right, #6aa06a, #4f8450);
}

.voice-btn.purple {
    background: linear-gradient(to right, #8a7ab7, #6f5da3);
}

.voice-btn.orange {
    background: linear-gradient(to right, #d99245, #b76e26);
}

/* ================= NAVIGATION ================= */

.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: rgba(230,210,185,0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 14px 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.08);
}

.nav-btn {
    background: none;
    border: none;
    font-size: 22px;
    opacity: 0.6;
    transition: 0.25s ease;
}

.nav-btn.active-nav {
    opacity: 1;
    transform: scale(1.2);
}

/* ================= RESPONSIVE ================= */

@media (min-width: 600px) {
    .app {
        max-width: 420px;
        margin: auto;
    }
}

#age-group {
    display: none;
}

#profile-card[data-mode="enfant"] #age-group {
    display: block;
}


/* =============================
   SUCCESS ANIMATION
============================= */

.success-check {
    width: 50px;
    height: 50px;
    background: #2ecc71;
    color: white;
    font-size: 26px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px auto 0;

    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.success-check.show {
    opacity: 1;
    transform: scale(1);
    animation: pop 0.4s ease;
}

@keyframes pop {
    0%   { transform: scale(0.5); }
    70%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-check.show {
    opacity: 1;
    transform: scale(1);
    animation: pop 0.4s ease, glow 1s ease;
}

@keyframes glow {
    0% { box-shadow: 0 0 0 rgba(46,204,113,0); }
    50% { box-shadow: 0 0 15px rgba(46,204,113,0.7); }
    100% { box-shadow: 0 0 0 rgba(46,204,113,0); }
}

/* =====================================================
   💬 MESSENGER / HISTORIQUE (AJOUT)
===================================================== */

.chat-card {
    padding: 18px;
}

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 460px;
    overflow-y: auto;
    padding: 10px;
    scroll-behavior: smooth;
}

/* Bulles */

.chat-bubble {
    padding: 14px 18px;
    border-radius: 22px;
    max-width: 75%;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    animation: fade 0.25s ease;
    word-wrap: break-word;
}

/* Message enfant */

.chat-child {
    background: linear-gradient(to right, #d8ecf8, #c6e3f5);
    align-self: flex-start;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Message Teddy */

.chat-teddy {
    background: linear-gradient(to right, #dff5e6, #c8ebd4);
    align-self: flex-end;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Heure */

.chat-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 6px;
    text-align: right;
}

/* Scrollbar douce */

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}

/* ================= CHAT INPUT ================= */

.chat-input-area {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.chat-input {
    flex: 1;
    padding: 14px 16px;
    border-radius: 20px;
    border: 2px solid #e0d0b8;
    background: #fff;
    font-size: 14px;
    outline: none;
}

.chat-input:focus {
    border-color: #b88a57;
}

.chat-parent {
    background: linear-gradient(to right, #fff0d6, #ffe3b3);
    align-self: flex-end;
    border: 2px solid #d6a34d;
}

.chat-send-btn {
    padding: 0 18px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(to right, #b88a57, #9c7445);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s ease;
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.logout-container {
  width: 100%;
  text-align: center;
  margin-top: 50px;
  padding-bottom: 30px;
}

.logout-btn {
  background: #ff4d4d;
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s ease;
}

.logout-btn:hover {
  background: #cc0000;
  transform: scale(1.05);
}


/* =====================================================
   🔐 LOGIN PAGE
===================================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    text-align: center;
}

.login-logo {
    position: relative;
    width: 220px;
    margin-bottom: 20px;
}

.teddy-login {
    width: 200px;
    position: relative;
    z-index: 1;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.login-card {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    padding: 25px;
    border-radius: 25px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.input-group {
    text-align: left;
    margin-bottom: 18px;
}

.input-group label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    display: block;
    color: #6b5a45;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    border: 2px solid #e0d0b8;
    background: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
    border-color: #b88a57;
    box-shadow: 0 0 0 4px rgba(184,138,87,0.12);
}

.forgot-password {
    margin-top: 8px;
}

.forgot-password a {
    color: #9c7445;
    font-size: 14px;
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.error-text {
    min-height: 20px;
    margin-top: 10px;
    color: #c0392b;
    font-size: 14px;
}

.register-section {
    width: 100%;
    max-width: 360px;
    margin-top: 18px;
}

.register-section p {
    margin-bottom: 12px;
    color: #6b5a45;
}

.btn-secondary-outline {
    display: inline-block;
    margin-top: 12px;
    padding: 14px 28px;
    border-radius: 30px;
    border: 2px solid #b88a57;
    background: transparent;
    color: #9c7445;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-secondary-outline:hover {
    background: linear-gradient(to right, #b88a57, #9c7445);
    color: white;
    box-shadow: 0 10px 25px rgba(156,116,69,0.35);
    transform: translateY(-2px);
}

.btn-secondary-outline:active {
    transform: scale(0.97);
}

.login-register-btn {
    width: 100%;
    max-width: 300px;
    padding: 14px;
    border-radius: 30px;
    border: 2px solid #b88a57;
    background: transparent;
    color: #9c7445;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.login-register-btn:hover {
    background: linear-gradient(to right, #b88a57, #9c7445);
    color: white;
    box-shadow: 0 10px 25px rgba(156,116,69,0.35);
    transform: translateY(-2px);
}

.login-register-btn:active {
    transform: scale(0.97);
}


.btn-secondary-outline:active {
    transform: scale(0.97);
}

.login-register-btn2 {
    width: 100%;
    max-width: 300px;
    padding: 14px;
    border-radius: 30px;
    border: 2px solid #b88a57;
    background: transparent;
    color: #9c7445;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.login-register-btn2:hover {
    background: linear-gradient(to right, #b88a57, #9c7445);
    color: white;
    box-shadow: 0 10px 25px rgba(156,116,69,0.35);
    transform: translateY(-2px);
}

.login-register-btn2:active {
    transform: scale(0.97);
}

@media (max-width: 480px) {
    .security-action-card {
        flex-direction: column;
        align-items: stretch;
    }

    .security-switch {
        align-self: flex-end;
    }
}
