/* ============================================
   Southco Payment Kiosk – Brand Styles
   Primary: #9d2235 (Southco Maroon)
   Dark:    #2d2d2d / #3a3a3a (Charcoal)
   Accent:  #c4364d (Light Maroon)
   Neutral: #5b6770 (Slate Gray)
   ============================================ */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(157, 34, 53, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(157, 34, 53, 0); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f4f4f4;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #2d2d2d;
}

.container {
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.5s ease-out;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border-top: 4px solid #9d2235;
}

.header {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    color: white;
    padding: 28px 30px;
    text-align: center;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #9d2235, #c4364d, #9d2235);
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
}

.header-logo {
    width: 200px;
    height: 60px;
    margin-bottom: 20px;
    background: white;
    padding: 8px 20px;
    border-radius: 10px;
    object-fit: cover;
    object-position: center 35%;
}

.header h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.device-id {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.device-id strong {
    color: #e8a0ab;
    font-family: 'Courier New', monospace;
}

/* Forms */
.form {
    padding: 30px;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #5b6770;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    background: #fafafa;
}

.form-group input:focus {
    border-color: #9d2235;
    box-shadow: 0 0 0 3px rgba(157, 34, 53, 0.1);
    background: #fff;
}

.form-group input::placeholder {
    color: #a2aaad;
}

.error-message {
    display: block;
    font-size: 12px;
    color: #9d2235;
    margin-top: 5px;
    min-height: 18px;
}

/* Buttons */
.submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: #9d2235;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.submit-btn:hover:not(:disabled) {
    background: #b32940;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(157, 34, 53, 0.35);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(157, 34, 53, 0.25);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-buttons {
    display: flex;
    gap: 12px;
}

.form-buttons .submit-btn {
    flex: 1;
    text-align: center;
    text-decoration: none;
}

.cancel-btn {
    background: #5b6770 !important;
}

.cancel-btn:hover {
    background: #6e7a84 !important;
    box-shadow: 0 4px 16px rgba(91, 103, 112, 0.35) !important;
}

/* Result messages */
.result {
    margin: 0 30px 30px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.result.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.result.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ============================================
   Dashboard Layout
   ============================================ */
.dashboard-body {
    align-items: flex-start;
    padding: 40px 20px;
    background: #f4f4f4;
}

.dashboard-container {
    width: 100%;
    max-width: 1120px;
    animation: fadeInUp 0.5s ease-out;
}

.dashboard-container .card {
    overflow: visible;
}

.dashboard-content {
    padding: 30px;
    overflow-x: auto;
}

.dashboard-actions {
    margin-bottom: 24px;
    display: flex;
    justify-content: flex-end;
}

.add-btn {
    display: inline-block;
    width: auto;
    padding: 10px 22px;
    text-decoration: none;
    text-align: center;
    font-size: 14px;
}

/* Device table */
.device-table {
    width: 100%;
    border-collapse: collapse;
}

.device-table th,
.device-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #ebebeb;
}

.device-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #5b6770;
    background: #f8f8f8;
}

.device-table tbody tr {
    transition: background 0.15s ease;
}

.device-table tbody tr:hover {
    background: #fdf2f4;
}

.device-mac {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #2d2d2d;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-registered {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge-unregistered {
    background: #f8f8f8;
    color: #5b6770;
    border: 1px solid #e5e7eb;
}

/* Action buttons */
.action-cell {
    white-space: nowrap;
}

.btn-action {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    margin-right: 6px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-qr {
    background: #fdf2f4;
    color: #9d2235;
    border-color: #f5c6cd;
}

.btn-qr:hover {
    background: #9d2235;
    color: white;
    border-color: #9d2235;
}

.btn-edit {
    background: #f0f7ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.btn-edit:hover {
    background: #1d4ed8;
    color: white;
    border-color: #1d4ed8;
}

.btn-delete {
    background: #fff;
    color: #999;
    border-color: #e5e7eb;
}

.btn-delete:hover {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Radio group */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 6px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: auto;
    accent-color: #9d2235;
}

/* Back link */
.back-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: white;
}

/* Helper text */
.helper-text {
    display: block;
    font-size: 12px;
    color: #5b6770;
    margin-top: 5px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #a2aaad;
    font-size: 15px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 22px;
    }

    .header h1 {
        font-size: 18px;
    }

    .form {
        padding: 22px;
    }

    .dashboard-content {
        padding: 16px;
    }
}
