/* /opt/GridHunter/frontend/www/user/assets/user.css */

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

body{
    background:#0d100c;
    color:#111;
    font-family:'Inter',sans-serif;
}

a{
    color:inherit;
    text-decoration:none;
}

button,
input,
select,
textarea{
    font-family:inherit;
}

button{
    color:inherit;
}

.btn-arrow-icon {
    width: 22px;
    height: 22px;
}


/* Layout */

.app{
    min-height:100vh;
    display:grid;
    grid-template-columns:280px 1fr;
}

.sidebar{
    background:#111712;
    color:white;
    padding:28px 24px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    border-right:1px solid rgba(255,255,255,.06);
}

.main{
    background:#f4f0e8;
    padding:42px;
}

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

.subscription-grid{
    grid-template-columns:1.4fr .9fr;
}

.two-col-grid{
    grid-template-columns:1fr 1fr;
}

.wide-card{
    min-height:260px;
}

.full-card{
    grid-column:1 / -1;
}

/* Logo */

.logo-wrap{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:40px;
}

.logo-wrap img{
    width:52px;
    height:52px;
    object-fit:contain;
    flex-shrink:0;
}

.logo-text{
    display:flex;
    flex-direction:column;
}

.logo-title{
    font-family:'Orbitron',sans-serif;
    font-size:18px;
    font-weight:700;
    letter-spacing:1px;
    line-height:1;
    color:#fff;
}

.logo-subtitle{
    font-family:'Orbitron',sans-serif;
    font-size:9px;
    font-weight:500;
    letter-spacing:2.5px;
    opacity:.7;
    margin-top:5px;
    color:#fff;
}

/* Navigation */

.nav{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.nav a{
    display:flex;
    align-items:center;
    gap:14px;
    padding:16px 18px;
    border-radius:8px;
    font-size:15px;
    color:#e7e7e7;
    transition:.2s;
}

.nav a.active,
.nav a:hover{
    background:linear-gradient(90deg,rgba(211,160,76,.35),rgba(211,160,76,.12));
    color:#d3a04c;
}

/* Sidebar footer */

.side-card{
    border:1px solid rgba(255,255,255,.12);
    border-radius:14px;
    padding:20px;
    margin-top:40px;
    background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.01));
}

.side-card strong{
    color:#d3a04c;
}

.side-card p{
    margin-top:6px;
    color:#aaa;
    font-size:13px;
    line-height:1.55;
}

.footer{
    margin-top:24px;
    color:#aaa;
    font-size:12px;
}

/* Icons */

.menu-icon{
    width:22px;
    height:22px;
    flex-shrink:0;
}

.card-heading{
    display:flex;
    align-items:center;
    gap:12px;
}

.page-icon{
    width:36px;
    height:36px;
    flex-shrink:0;
}

.hero-icon,
.shield-icon{
    width:64px;
    height:64px;
    flex-shrink:0;
}

.device-icon{
    width:28px;
    height:28px;
    flex-shrink:0;
}

/* Top */

.top{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:34px;
}

.welcome h2{
    font-size:20px;
    font-weight:500;
}

.welcome h1{
    font-size:42px;
    margin-top:6px;
}

.welcome p{
    margin-top:12px;
    color:#555;
    font-size:17px;
}

.user-badge{
    display:flex;
    align-items:center;
    gap:14px;
}

.avatar{
    width:46px;
    height:46px;
    border-radius:50%;
    background:#1f291d;
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:700;
}

/* Hero status */

.protected{
    background:#090b09;
    color:white;
    border-radius:14px;
    padding:26px 32px;
    margin-bottom:26px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    border:1px solid rgba(255,255,255,.08);
    box-shadow:0 10px 25px rgba(0,0,0,.18);
}

.protected-left{
    display:flex;
    align-items:center;
    gap:22px;
}

.protected h3{
    font-size:22px;
    margin-bottom:6px;
}

.protected p{
    color:#c9c9c9;
}

.dot{
    width:12px;
    height:12px;
    border-radius:50%;
    background:#20d067;
    box-shadow:0 0 12px rgba(32,208,103,.8);
    flex-shrink:0;
}

/* Cards */

.card{
    background:#fffaf1;
    border:1px solid rgba(0,0,0,.08);
    border-radius:14px;
    padding:26px;
    box-shadow:0 8px 20px rgba(0,0,0,.05);
}

.card-title{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    margin-bottom:22px;
    padding-bottom:18px;
    border-bottom:1px solid rgba(0,0,0,.1);
}

.card-title h3{
    font-size:22px;
}

.status{
    display:flex;
    align-items:center;
    gap:8px;
    color:#111;
    font-weight:600;
}

.status::before{
    content:"";
    width:9px;
    height:9px;
    border-radius:50%;
    background:#20d067;
}

/* Info */

.info-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px 30px;
    margin-bottom:24px;
}

.label{
    color:#666;
    font-size:14px;
    margin-bottom:5px;
}

.value{
    font-size:18px;
    font-weight:700;
}

.gold{
    color:#b57a2f;
}

.green{
    color:#168b3a;
}

.red{
    color:#c73a3a;
}

.note{
    margin-top:22px;
    color:#666;
    line-height:1.6;
}

.link-muted{
    color:#666;
}

/* Forms */

.form-row{
    width:100%;
}

.input,
.textarea{
    width:100%;
    padding:14px 16px;
    font-size:15px;
    font-family:inherit;
    border-radius:10px;
    border:1px solid rgba(0,0,0,.12);
    background:#fff;
    outline:none;
    margin-top:6px;
}

.input:focus,
.textarea:focus{
    border-color:#d3a04c;
    box-shadow:0 0 0 3px rgba(211,160,76,.15);
}

.textarea{
    resize:vertical;
    min-height:220px;
}

.checkbox{
    display:flex;
    align-items:center;
    gap:12px;
    margin:18px 0;
    font-size:15px;
}

.checkbox input{
    width:18px;
    height:18px;
    accent-color:#d3a04c;
}

/* Buttons */

.actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}

.btn{
    display:flex;
    align-items:center;
    justify-content:center;
    border:none;
    border-radius:8px;
    padding:15px 18px;
    font-weight:700;
    cursor:pointer;
    transition:.2s;
}

.btn-primary{
    background:#090b09;
    color:white;
}

.btn-primary:hover{
    background:#1f291d;
}

.btn-secondary{
    background:#fffaf1;
    border:1px solid rgba(0,0,0,.18);
}

.btn-secondary:hover{
    background:#f1eadf;
}

.btn-danger{
    background:#c73a3a;
    color:#fff;
}

.btn-danger:hover{
    background:#a92f2f;
}

.stack-actions{
    display:flex;
    flex-direction:column;
    border:1px solid rgba(0,0,0,.1);
    border-radius:10px;
    overflow:hidden;
}

.action-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding:18px 20px;
    background:#fffaf1;
    border:none;
    border-bottom:1px solid rgba(0,0,0,.08);
    font-size:15px;
    cursor:pointer;
    text-align:left;
}

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

.action-row:hover{
    background:#f1eadf;
}

/* Traffic */

.traffic{
    display:flex;
    align-items:center;
    gap:24px;
}

.ring{
    width:130px;
    height:130px;
    border-radius:50%;
    border:12px solid #d3a04c;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:46px;
    margin:auto;
}

.traffic-box{
    background:#f1eadf;
    border-radius:10px;
    padding:22px;
    min-width:130px;
}

.traffic-box strong{
    display:block;
    font-size:30px;
    margin:8px 0;
}

/* Devices */

.device-count{
    font-size:22px;
    font-weight:800;
    margin-bottom:12px;
}

.progress{
    height:7px;
    border-radius:20px;
    background:#ddd3c5;
    overflow:hidden;
    margin-bottom:22px;
}

.progress span{
    display:block;
    height:100%;
    width:33%;
    background:#d3a04c;
}

.device{
    display:flex;
    align-items:center;
    gap:14px;
    padding:16px 0;
    border-top:1px solid rgba(0,0,0,.08);
}

.device small{
    display:block;
    color:#666;
    margin-top:4px;
}

.badge{
    margin-left:auto;
    font-size:12px;
    background:#d8f5df;
    color:#168b3a;
    padding:5px 9px;
    border-radius:20px;
    font-weight:700;
}

/* Subscription */

.subscription-url{
    background:#090b09;
    color:#d3a04c;
    border-radius:10px;
    padding:18px 20px;
    font-family:"Courier New",monospace;
    font-size:15px;
    word-break:break-all;
}

/* Downloads */

.download-card .actions{
    margin-top:22px;
}

/* Settings */

.danger{
    border:1px solid rgba(220,60,60,.35);
    background:#fff7f7;
}

/* Login */

.login-main{
    padding:44px 56px;
}

.login-hero{
    min-height:118px;
    margin-bottom:32px;
    padding:28px 34px;
}

.login-hero-icon{
    width:44px;
    height:44px;
    padding:10px;
    border-radius:14px;
    background:rgba(211,160,76,.12);
}

.system-status{
    display:flex;
    align-items:center;
    gap:12px;
    font-size:15px;
    font-weight:700;
    color:#fff;
    opacity:.92;
}

.login-grid{
    display:grid;
    grid-template-columns:minmax(520px,1.1fr) minmax(420px,.95fr);
    gap:28px;
    align-items:stretch;
}

.login-card,
.login-info-card{
    min-height:540px;
    padding:34px;
}

.login-card .card-title,
.login-info-card .card-title,
.login-notice .card-title{
    padding-bottom:24px;
    margin-bottom:24px;
}

.login-card .card-heading,
.login-info-card .card-heading{
    gap:18px;
}

.login-card .page-icon,
.login-info-card .page-icon,
.login-notice .page-icon{
    width:38px;
    height:38px;
}

.login-card h3,
.login-info-card h3,
.login-notice h3{
    font-size:27px;
    line-height:1.1;
}

.login-form{
    display:flex;
    flex-direction:column;
    gap:18px;
}

.login-note{
    margin:0 0 4px;
    font-size:16px;
    line-height:1.55;
}

.password-field{
    display:grid;
    grid-template-columns:1fr 64px;
    gap:8px;
}

.password-field .input{
    min-height:48px;
    margin-top:0;
    padding-right:16px;
}

.password-toggle{
    min-height:48px;
    border:1px solid rgba(0,0,0,.14);
    border-radius:10px;
    background:rgba(255,255,255,.42);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition:.2s;
}

.password-toggle:hover{
    background:#f1eadf;
    border-color:rgba(211,160,76,.52);
}

.password-toggle img{
    width:22px;
    height:22px;
    opacity:.78;
}

.login-options{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin-top:2px;
    font-size:14px;
}

.login-options .checkbox{
    margin:0;
}

.login-options a{
    color:#b6842f;
    font-weight:600;
}

.login-actions{
    display:grid;
    gap:14px;
    margin-top:8px;
}

.login-actions .btn{
    min-height:54px;
    border-radius:10px;
    font-size:15px;
    position:relative;
}

.btn-arrow{
    position:absolute;
    right:24px;
    color:#d3a04c;
    font-size:28px;
    line-height:1;
}

.login-info-card .note{
    margin-top:0;
    margin-bottom:26px;
    font-size:16px;
}

.login-feature-list{
    gap:0;
}

.login-info-card .action-row{
    min-height:66px;
    padding:0 22px;
    border-radius:0;
}

.action-left{
    display:flex;
    align-items:center;
    gap:16px;
}

.action-icon{
    width:34px;
    height:34px;
    border-radius:50%;
    border:1px solid rgba(0,0,0,.08);
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(255,255,255,.34);
    flex-shrink:0;
}

.action-icon img{
    width:18px;
    height:18px;
}

.login-info-card .action-row strong{
    color:#c08d35;
    font-size:24px;
}

.login-notice{
    grid-column:1 / -1;
    min-height:142px;
    padding:28px 34px;
    position:relative;
    overflow:hidden;
}

.login-notice .note{
    max-width:920px;
    margin:0;
    font-size:16px;
}

.notice-bg-icon{
    position:absolute;
    right:58px;
    bottom:10px;
    width:118px;
    height:118px;
    opacity:.24;
}

/* Responsive */

@media(max-width:1180px){
    .login-grid{
        grid-template-columns:1fr;
    }

    .login-card,
    .login-info-card{
        min-height:auto;
    }
}

@media(max-width:1100px){
    .app{
        grid-template-columns:1fr;
    }

    .sidebar{
        display:none;
    }

    .grid,
    .subscription-grid,
    .two-col-grid{
        grid-template-columns:1fr;
    }

    .top{
        flex-direction:column;
        align-items:flex-start;
        gap:20px;
    }
}

@media(max-width:760px){
    .login-main{
        padding:28px 18px;
    }

    .login-hero,
    .login-card,
    .login-info-card,
    .login-notice{
        padding:24px;
    }

    .login-grid{
        gap:18px;
    }

    .password-field{
        grid-template-columns:1fr;
    }

    .login-options{
        align-items:flex-start;
        flex-direction:column;
        gap:12px;
    }

    .notice-bg-icon{
        display:none;
    }
}

@media(max-width:700px){
    .main{
        padding:24px;
    }

    .welcome h1{
        font-size:34px;
    }

    .protected{
        flex-direction:column;
        align-items:flex-start;
        gap:20px;
    }

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

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

    .traffic{
        flex-direction:column;
        align-items:flex-start;
    }
}

/* Logout */
.btn-small{
    padding:9px 12px;
    font-size:13px;
}

.auth-slot{
    display:flex;
    align-items:center;
}

/* Phase 1 UI Components */

/* Toasts */
.toast-container{position:fixed;top:22px;right:22px;z-index:3000;display:flex;flex-direction:column;gap:12px;width:min(380px,calc(100vw - 32px));pointer-events:none;}
.toast{display:flex;align-items:flex-start;gap:14px;padding:16px 18px;border-radius:14px;background:#fffaf1;border:1px solid rgba(0,0,0,.1);box-shadow:0 18px 40px rgba(0,0,0,.18);color:#111;pointer-events:auto;animation:toast-in .22s ease-out;}
.toast.is-hiding{animation:toast-out .18s ease-in forwards;}
.toast-icon{width:12px;height:12px;border-radius:50%;margin-top:5px;flex-shrink:0;background:#d3a04c;box-shadow:0 0 12px rgba(211,160,76,.55);}
.toast-success .toast-icon{background:#20d067;box-shadow:0 0 12px rgba(32,208,103,.7);}
.toast-error .toast-icon{background:#c73a3a;box-shadow:0 0 12px rgba(199,58,58,.55);}
.toast-warning .toast-icon{background:#d3a04c;}
.toast-info .toast-icon{background:#090b09;}
.toast-content{flex:1;}
.toast-title{font-weight:800;margin-bottom:4px;}
.toast-message{color:#666;line-height:1.45;font-size:14px;}
.toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close svg,
.toast-close img {
    width: 18px;
    height: 18px;
}

@keyframes toast-in{from{opacity:0;transform:translateY(-8px) translateX(12px);}to{opacity:1;transform:translateY(0) translateX(0);}}
@keyframes toast-out{to{opacity:0;transform:translateY(-8px) translateX(12px);}}

/* Modals */
.modal-backdrop{position:fixed;inset:0;z-index:2500;display:none;align-items:center;justify-content:center;padding:24px;background:rgba(9,11,9,.72);backdrop-filter:blur(6px);}
.modal-backdrop.is-open{display:flex;}
.modal{width:min(560px,100%);max-height:calc(100vh - 48px);overflow:auto;background:#fffaf1;border:1px solid rgba(211,160,76,.22);border-radius:18px;box-shadow:0 24px 70px rgba(0,0,0,.34);animation:modal-in .2s ease-out;}
.modal-header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:24px 26px 18px;border-bottom:1px solid rgba(0,0,0,.1);}
.modal-title{display:flex;align-items:center;gap:12px;}
.modal-title h3{font-size:22px;}
.modal-close{width:38px;height:38px;display:flex;align-items:center;justify-content:center;border:1px solid rgba(0,0,0,.12);border-radius:10px;background:#fffaf1;cursor:pointer;font-size:24px;line-height:1;}
.modal-close:hover{background:#f1eadf;}
.modal-body{padding:24px 26px;color:#111;line-height:1.6;}
.modal-actions{display:flex;justify-content:flex-end;gap:12px;padding:0 26px 26px;}
.modal-actions .btn{min-width:120px;}
@keyframes modal-in{from{opacity:0;transform:translateY(12px) scale(.98);}to{opacity:1;transform:translateY(0) scale(1);}}

/* Loading */
.spinner{width:22px;height:22px;border-radius:50%;border:3px solid rgba(211,160,76,.28);border-top-color:#d3a04c;animation:spin .8s linear infinite;}
.btn .spinner{width:18px;height:18px;border-width:2px;margin-right:10px;}
@keyframes spin{to{transform:rotate(360deg);}}
.is-loading{position:relative;pointer-events:none;opacity:.78;}
.skeleton{display:block;border-radius:10px;background:linear-gradient(90deg,#eee4d6,#fffaf1,#eee4d6);background-size:200% 100%;animation:skeleton 1.2s ease-in-out infinite;}
.skeleton-line{height:14px;margin-bottom:10px;}
.skeleton-title{width:45%;height:24px;margin-bottom:18px;}
.skeleton-card{min-height:160px;}
@keyframes skeleton{from{background-position:200% 0;}to{background-position:-200% 0;}}

/* Empty state */
.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px;min-height:220px;padding:34px;color:#666;}
.empty-state img{width:56px;height:56px;opacity:.72;}
.empty-state h3{color:#111;font-size:22px;}

/* QR placeholder */
.qr-box{width:220px;height:220px;margin:0 auto 18px;border-radius:18px;border:1px solid rgba(0,0,0,.12);background:linear-gradient(90deg,#090b09 12px,transparent 12px) 0 0/28px 28px,linear-gradient(#090b09 12px,transparent 12px) 0 0/28px 28px,#fffaf1;box-shadow:inset 0 0 0 14px #fffaf1;}
.qr-note {
    margin-top: 0;
    text-align: center;
}
.copy-value{background:#090b09;color:#d3a04c;border-radius:10px;padding:14px 16px;font-family:"Courier New",monospace;font-size:14px;word-break:break-all;}
@media(max-width:700px){.toast-container{top:14px;right:14px;left:14px;width:auto;}.modal-backdrop{padding:14px;}.modal-actions{display:grid;grid-template-columns:1fr;}.modal-actions .btn{width:100%;}}
