/* public/portal/portal.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --background: #f3f4f6;
    --surface: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --error: #dc2626;
    --success: #16a34a;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.portal-container {
    width: 100%;
    max-width: 420px;
    margin: 4rem auto;
    padding: 0 var(--spacing-md);
}

/* Components */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xl);
    border: 1px solid var(--border);
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    width: auto;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--text);
    font-size: 0.95rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--surface);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.error-msg {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: var(--spacing-sm);
    text-align: center;
    background: #fee2e2;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    display: none;
}

.error-msg.show {
    display: block;
}

/* Navbar */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-xl);
    position: sticky;
    top: 0;
    z-index: 10;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-email {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: none;
    /* Hidden on mobile by default */
}

@media (min-width: 640px) {
    .user-email {
        display: block;
    }
}

/* Dashboard Grid */
.devices-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

@media (min-width: 768px) {
    .devices-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .devices-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Device Card */
.device-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.device-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    background: #f9fafb;
}

.device-body {
    padding: var(--spacing-lg);
}

.device-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    background: #f9fafb;
    border-top: 1px solid var(--border);
    display: flex;
    gap: var(--spacing-sm);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-offline {
    background: #f3f4f6;
    color: #4b5563;
}

.section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin: var(--spacing-lg) 0 var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.25rem;
}

.section-title:first-child {
    margin-top: 0;
}

/* Utilities */
.flex-1 {
    flex: 1;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.w-full {
    width: 100%;
}

@media (max-width: 640px) {
    .mobile-stack {
        flex-direction: column;
    }

    .mobile-w-full {
        width: 100% !important;
    }
}
/* Success Message */
.success-msg {
    color: var(--success);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    display: none;
}

.success-msg.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
